Bug in compare text

Hello there, Its a bugs I found while working on comparing text ---- I have taken screenshot are below

pic%201 pic%202

when input three digit number it’s can’t compare … but it’s ok with 2 digit number… what to do ?

Hi @maphy_r,

The (Compare) function is reduce boolean value (true or false) which is if value1 = value2 then the result is true, else is false.

So, exchange (Compare) block with ( = ) block (you can find it either at math category or logic category)

Thanks

If you input 2 digit number such as 70 or 90 – it’s working nice but when its become 3 digit number it’s wont working… please try it

That’s right, the type of variable you handle is important. It is not a Kodular error but yours when comparing variables. This is an example_

blocks

2 Likes

Yes maybe,

But try that I wrote it. maybe will solve your problem.

2 Likes

Thank you – it’s working :heart_eyes:

1 Like

Hi @maphy_r
It is not adviced to compare numbers with compare block as it is for comparing strings.
You should use math block to compare numbers.

1 Like

Yap! Bro I got it :blush:

Then let others know it by making an appropriate post as your solution.

Don’t Use Compare Block Use The Math Block It’s Work

The compare block works too but it is based on text length.

2 Likes

The compare block returns whether or not the first string is lexicographically <, >, or = the second string depending on which dropdown is selected.

A string a considered lexicographically greater than another if it is alphabetically greater than the other string. Essentially, it would come after it in the dictionary. All uppercase letters are considered smaller or to occur before lowercase letters. cat would be > Cat .

3 Likes