I recently ran into something similar trying to use a value in a string without the unit, and used this…
val String testTemp = gTemperatureUpstairs.state.format("%.0f")
Which means these could also be used…
val Integer testTemp1 = Integer::parseInt(gTemperatureUpstairs.state.format("%.0f"))
val Double testTemp2 = Double::parseDouble(gTemperatureUpstairs.state.format("%.3f"))
To do this the way you were trying, it would need to be like this…
var Number CurrentValue = (Bad_temp.state as QuantityType<Number>).doubleValue
I don’t know the answer to this one, but could you describe why you would need it? Since you’ve defined the item, then wouldn’t you already know this?