Rounding QuantityType<Temperature> values to 0.5 °C

I don’t see why?

I want “21.3°C” in my message string, not “21.28478 °C”

var message = "Temperature is " + (tempItemC.state as QuantityType<Temperature>).format("%.1f%unit%")
// returns "Temperature is 10.0°C"

from

Long story short - there is no easy way to round a Quantity, because the granularity, the “detents” that you are trying to round to all depends on the units you are expressing the quantity in at the time. Rounding identical quantities 1200.1m and 1.2001km to “integer” does not give the same result.