So if I write round(2) I limit to two decimal places, round(3) to three and so on.
Sorry if I take advantage, can you also explain the meaning of float()?
These are all filters you can use in Jinja (name of the template language of HA). If you need further or deeper knowledge, refer to the Python documentation as well.
I’m curious to know why you added the round filter to the template if you don’t know what it does.
For future reference, you can test your templates in the Template Editor (Developer Tools > Template). It’s a good way to easily experiment and see the result of a template.
I encourage you to copy-paste the following into the Template Editor and observe the results.
Home Assistant’s templates use the Jinja2 templating language. Many of its features are documented here: Templating. For example, here’s the description of the round filter.
Simply because I copied it. Obviously, being a newbie. But you have given me excellent advice and I thank you.
Ah, I forgot, the two codes above give the same result and I don’t understand why.