Display bug in my card?

Hello,

I have this code generating this display.

value_template: "{{  states('sensor.daily_energy_creuses') | float + states('sensor.daily_energy_pleines') | float | round(2) }}"

Capture d’écran 2020-04-21 à 20.11.20

Is there a bug in my formula ?

Nope. round() is a function that is subject to the precision problems of floating point math.

You want to format the output instead.

value_template: "{{ '%.2f'|format( states('sensor.daily_energy_creuses') | float + states('sensor.daily_energy_pleines') | float) }}"
1 Like

Thanks you !