# Logic block \< comparison fails

**URL:** <https://community.thunkable.com/t/logic-block-comparison-fails/3364446>\
**Category:** Questions about Thunkable X\
**Created:** [November 23, 2024, 2:57pm UTC](https://community.thunkable.com/t/logic-block-comparison-fails/3364446 "2024-11-23T14:57:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anandavardhana57zwwl](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anandavardhana57zwwl](https://community.thunkable.com/u/anandavardhana57zwwl)\
**Post date:** [November 23, 2024, 2:57pm UTC](https://community.thunkable.com/t/logic-block-comparison-fails/3364446/1 "2024-11-23T14:57:54Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/152e7f28873bcf9eaf34aa9895d307518242301f.png)  
This is a very simple Elevator(Lift) app. When MoveLiftToTxt goes unfocus the Lift should go up or down. Initially everything is set to 0 the Lift is at the bottom.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/c/3cc69ccc253f7fda2948b35dab7b1eba1a2b1d65.png)  
I type 10 in the Move Lift and go unfocus the Lift goes up perfect.  
Error Message has “10 and 0” and “up” messages  
I type 3 in the Move Lift and go unfocus the Lift goes up??  
Error Message has “3 and 10” and “up” messages  
The Logical \< comparison fails.  
Both the Move Lift and Lift Pos inputs are numeric.  
Why should the logical \< comparison fail? Just baffling. Please help.

---

<div class="post-metadata">

**Author:** ![terraceaccapp3hc7yk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/terraceaccapp3hc7yk/32/189221_2.png) [@terraceaccapp3hc7yk](https://community.thunkable.com/u/terraceaccapp3hc7yk)\
**Post date:** [November 23, 2024, 9:12pm UTC](https://community.thunkable.com/t/logic-block-comparison-fails/3364446/2 "2024-11-23T21:12:31Z")

</div>

I just checked some posts like this and I’m guessing (since I can’t see where you define movelifttotxt), that movelifttotxt is still text.  
To convert it to number you can have it to equal movelifttxt + 0.  
See the post below for further information.

> [@\[Solved\] Issues with \> and \< blocks in logic](https://community.thunkable.com/t/solved-issues-with-and-blocks-in-logic/464350/2):
>
> Hi, @Patrick_Elisha! wave I think today an issue is coming while comparing numerals. An alike question was answered today by me - [[Solved] Problems with numbers from Labels - #4 by kartik14](http://community.thunkable.com/t/problems-with-numbers/463414/4) These blocks could help you - What I did? I just added a \<textInput(A/B)\> + 0. It doesn’t change the value of the textInput, but (I think) it converts the text to proper numbers, so we can compare. Hope I helped you slight_smile Thanks! blush

---

<div class="post-metadata">

**Author:** ![anandavardhana57zwwl](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anandavardhana57zwwl](https://community.thunkable.com/u/anandavardhana57zwwl)\
**Post date:** [November 24, 2024, 5:35am UTC](https://community.thunkable.com/t/logic-block-comparison-fails/3364446/3 "2024-11-24T05:35:08Z")

</div>

Hi Thanks for the reply but I had initialized it as numeric 0 when clearing and I knew the +0 trick you mentioned but since it was initialized to numeric 0 I thought it was redundant. However your reply and the images you shared helped me to rethink my basic algorithm. My Y value was being calculated wrongly. I just fixed it. Now the other bugs are also gone. Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [February 22, 2025, 5:35am UTC](https://community.thunkable.com/t/logic-block-comparison-fails/3364446/4 "2025-02-22T05:35:13Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
