I created a simple calculation to give me mortality rate for this over-hyped coronavirus but the rounding doesn’t seem to work properly.
If I use round(2) I get a figure with only 1 decimal place, the same as if I use round(1), whereas round(3) gives me 3 decimal places… is this a bug in HA or am I doing something wrong? (it is my first time creating a calculation like this)
EDIT: only works in the template dev tool… fails in practice due to the %
EDIT again: fixed it by swapping a set of quotes to singles value_template: "{{ '%.2f'|format(((states('sensor.worldwide_coronavirus_deaths') | float * 100) / (states('sensor.worldwide_coronavirus_confirmed') | float ))) }}"
True, but I’m looking at how the mortality rate is dropping as more and more people recover safely. Once a huge number of people are infected and subsequently recover I think we will see that it isn’t as bad as the media is making out. So far unless you are really old, you should be ok… I may be proven wrong but at this stage I just want my overseas holiday to go ahead in 2 week’s time!