To set the number of decimal places, the value_template can be used. However, this is quite cumbersome, whilst this would be very convenient to configure this within the UI.
As an example, the value formatting in Excel can be used. This allows to easily select various formats depending on the field type (number, date, time, …) still allowing a high level of customization.
If the value has a unique_id, it can be set to the precision level in the UI using the gear on the entity and changing the ‘Display Precision’.
Otherwise as you said, templates when available.
Thanks a lot, I was not aware about this setting.
This setting does not seem to be respected by some cards, for example the statistic
card, which will stubbornly show 2 decimals even though the source entity Display Precision has been set to 0. Really frustrated by this and the fact that cards don’t have their own decimal setting.
Hi hjatsuu,
This might be as intended, it might not.
I suggest a frontend discussion or issue or something with your example and you may get some help with it.
https://github.com/home-assistant/frontend/discussions.
or
Issues · home-assistant/frontend · GitHub.