Force displayed decimals on a sensor without unique_id?

Hi there,

is there a way to force the display of decimals?
What i have, is a template card (done in yaml, not UI) and among other things i use

{{ states('sensor.solar_yearly_kwh_total') | round(2) }}

This sensor is also created in yaml (not via UI), so i cannot change the display precision here.

What happens: the card shows the values rounded to 2 decimals β†’ correct.
But if the rounded value is for instance 2.1 it only shows this. I want it to display 2.10.
The reason for that is, that i have 3 sensor vaules displayed in a row and every now and then the displayed row shifts, if the decimals are changing from two to one - it’s just not easy for the eye.

Thank you all.

1 Like