[Solved] How to compare numeric text fields?

Why is A NOT bigger than B and how should we code this to get the correct result?

1 Like

Use a +0 block with both of the get texts. These blocks alone return text and we need them to be numbers in order to perform operations on them, and compare them.


Thank you that worked.

In case you’re curious, text gets alphabetized so while you might expect Apple to come before Banana and perhaps wouldn’t be surprised by Apple < Banana , it seems strange that 12.00 < 6.99. However, since the “number” you’re seeing is getting alphabetized, the first character of each text input is 1 vs. 6. And in fact 1 < 6 so the full text “12.00” comes before “6.99”.

1 Like