Error when casting Temperature value to E-Mail

There’s a bit about formatting at the bottom of this post

example

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

“as Number” will not work because it comes with the units string which cannot be processed by decimal formatters like “%.2f”
“as QuantityType” gives you a units-friendly formatter.