Number:Length item state is including semantic info in dsl rules (ie item.state== "23 in")

In openhab 3 is there a way to get the actual item number value out of when working in DSL rules? I know I could split it based on a space and then switch the first half to a number but that seems like a hack. As it stands when using if statements to compare numberLength Item.state is completely impossible as that .state value includes the descriptor of ‘in’ and therefore breaks the comparison. Do I need to append inches to the other side or use some sort of length type variable?

example: Item is defined as Number::Length and the current value is 12

(obviously changing to a plain number item fixes it but that removes some of the value)

If(item.state > 12)
do something

resolves to this:
if( “12 in” > 12)
do something

that obviously isn’t evaluating correctly and therefore my rule is broken

Here an example for Number:Temperature, but the concept is the same:

This is sort-of explained in the documentation, though it’s easy to miss the significance.

Your analysis is spot-on, and as @hafniumzinc says you are discovering Quantity Types.

Some practical tools, beyond just comparisons -

Thanks for the quick feedback - I knew what it was I just had trouble finding it it in the documentation. I had a feeling there was a certain way to deal with it either way but was lost outside of just putting a plain number. Thanks again for your help!