Working with "number:temperature"

The binding for my temperature sensor is now Number:Temperature. When using in a script it seems to consist now of two values: “25.1 ?”.
I need the raw temperature value. How to extract that?
If a change the type back to “Number” after binding, it’s ok.

@Garbisa Have a look here

Working with Number:Temperature item type

var temperature = myItem.state as Number

That does not the trick. The variable still contains e.g. “28.7 ?”

Thanks cweitkamp for the link and your explanation there.
I think I will stay with my trick to change back the “Number:Temperatur” type to simple “Number” after linking in the binding. Also aeotec multisensor does not return the correct unit.
I see no advantage using “Number:Temperatur” variables - just more work.

You are welcome.

Fair enough to use Number only if it is sufficient for you. I guess most of the bindings can deal with both.