# Convert Text Input to int/ How to make numeric input that can be used for Math

**URL:** <https://community.thunkable.com/t/convert-text-input-to-int-how-to-make-numeric-input-that-can-be-used-for-math/921118>\
**Category:** Questions about Thunkable X\
**Tags:** firebase\
**Created:** [October 22, 2020, 6:01am UTC](https://community.thunkable.com/t/convert-text-input-to-int-how-to-make-numeric-input-that-can-be-used-for-math/921118 "2020-10-22T06:01:47Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 23, 2020, 4:01am UTC](https://community.thunkable.com/t/convert-text-input-to-int-how-to-make-numeric-input-that-can-be-used-for-math/921118/20 "2020-10-23T04:01:12Z")

</div>

> [@tatiang](#):
>
> Yep, that should have worked. If you set text labels to the two variable values and to their values with zero added, what do you get?

I’m not sure you’re understanding what I suggested. I have a hard time believing that the math functions in Thunkable are broken ([asin notwithstanding](http://community.thunkable.com/t/math-help-formula-not-working/917769/12)) or that adding zero to a text string doesn’t convert it to a number.

So the only other thing that could be causing “NaN” to appear is that your text strings are not valid numbers. For example, it’s possible that having a space or a punctuation mark within the string will invalidate it even when adding zero to it.

So the next step should be to create two labels on the screen. They should be **different** label components but I’ve shown them as the same in this screenshot:

 ![Screen Shot 2020-10-22 at 8.57.26 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/e/be64f395a1da5838a2956577ff290bf93ea5e3b4.png)

The idea is to generate two results, both bookended by Xs. So for example, if you see something like…

X5489X

…then you know it’s a valid string to convert to a number by adding zero to it.

But if you see…

X 5489X then there’s potentially a problem because your string is " 5489" with a leading space.

And if you see…

XX then you know the database Get block failed because your string is “”.

Also, what are your green error blocks showing if you add them to labels so you can see their value?

This type of troubleshooting is really common with Thunkable (and any programming language/environment) so if you’re new to Thunkable, these are good skills to start using.

---

_[View the full topic](https://community.thunkable.com/t/convert-text-input-to-int-how-to-make-numeric-input-that-can-be-used-for-math/921118)._
