Hi,
i have the following template sensor:
feinstaub_luftdruck_hpa:
value_template: '{{ states("sensor.feinstaub_luftdruck") | float / 100 | round(2) }}'
friendly_name: "Luftdruck"
unit_of_measurement: "hPa"
As you can see, i’d like to round the result of the division with 100 to a value of two decimals. However, i seem to be unable to do this. Currently, the value of this template sensor is: 1007.0975999999999
while the raw value of the sensor input for the template is 100709.76
. I do not understand where the suffix of 9 comes from. It looks like a rounding error. Sometimes the value is displayed correctly, but with four decimals, and not with two decimals, like desired. Where is my error?