# Numbers in TextInput/Label

**URL:** <https://community.thunkable.com/t/numbers-in-textinput-label/10282>\
**Category:** Questions about Thunkable X\
**Created:** [November 7, 2017, 11:09am UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282 "2017-11-07T11:09:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rollke](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rollke/32/14413_2.png) [@rollke](https://community.thunkable.com/u/rollke)\
**Post date:** [November 7, 2017, 11:09am UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/1 "2017-11-07T11:09:11Z")

</div>

I want to set a number as a result into a field.  
It works perfectly to set a number in a Label.  
But trying to set a number into a TextInput field fails.

Is tha a bug or intended?

PS: It could be useful to get a pair of functions in Math and Text to change the type of a variable from text to number and vice versa.

---

<div class="post-metadata">

**Author:** ![albert](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/albert/32/4077_2.png) [@albert](https://community.thunkable.com/u/albert)\
**Post date:** [November 7, 2017, 11:39pm UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/2 "2017-11-07T23:39:49Z")

</div>

Hi there. We just released the ability to set your Text Input keyboard to Numbers Only – hopefully this helps you with your Math functions.

Albert

> [@Thunkable iOS Release (Nov 6) - new Web API component, Button 2.0, Text Input 2.0](http://community.thunkable.com/t/thunkable-ios-release-nov-6-new-web-api-component-button-2-0-text-input-2-0/10255):
>
> Hey Thunkers, We’re excited to announce a few new features on iOS today: New [Web API Component](https://docs.thunkable.com/ios/components/storage/web-api.html) (similar to Web component on Android). We are SO excited about this component that many of you have requested since it not only allows you to tap into data from the best public and private web APIs out there but @Mark also designed a new set of blocks called Object blocks that makes formatting the data you retrieve from the APIs a breeze. [Button](https://docs.thunkable.com/ios/components/user-interface/button.html) (2.0!) – we added additional st…

---

<div class="post-metadata">

**Author:** ![rollke](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rollke/32/14413_2.png) [@rollke](https://community.thunkable.com/u/rollke)\
**Post date:** [November 9, 2017, 12:17pm UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/3 "2017-11-09T12:17:13Z")

</div>

It helps only a little.  
Yes: The input for numbers is much easier now.  
No: The type of the value of a text\_input field is still of type string, wich makes math operations with these values impossible and a set-operation with a number is not possible.

I think that the content of text\_input elements should be generic and should to be typecast to the appropriate type by the system depending on the operation made with them.

---

<div class="post-metadata">

**Author:** ![Karthikeyan\_M](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@Karthikeyan\_M](https://community.thunkable.com/u/Karthikeyan_M)\
**Post date:** [February 10, 2018, 5:47am UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/4 "2018-02-10T05:47:56Z")

</div>

Any update on this. Still unable to use text field for arithmetic operation even after enabling Numbers only in the text field.

---

<div class="post-metadata">

**Author:** ![Renier\_Engelbrecht](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/renier_engelbrecht/32/15192_2.png) [@Renier\_Engelbrecht](https://community.thunkable.com/u/Renier_Engelbrecht)\
**Post date:** [February 24, 2018, 4:31am UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/5 "2018-02-24T04:31:15Z")

</div>

Hi there  
I created a workaround in the meantime using a function,

 ![thunkable_add numbers](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/e/e0a9f94623d9678d700f90528eba7354a42916e7.png)  
It would really be great if they can fix this issue, but in the meantime we can use this.

---

<div class="post-metadata">

**Author:** ![Renier\_Engelbrecht](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/renier_engelbrecht/32/15192_2.png) [@Renier\_Engelbrecht](https://community.thunkable.com/u/Renier_Engelbrecht)\
**Post date:** [February 24, 2018, 4:33am UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/6 "2018-02-24T04:33:28Z")

</div>

![thunkable_add numbers](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/2X/1/1346583eb4d18c3a8d339c749f0914d54361d233.png)

---

<div class="post-metadata">

**Author:** ![Renier\_Engelbrecht](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/renier_engelbrecht/32/15192_2.png) [@Renier\_Engelbrecht](https://community.thunkable.com/u/Renier_Engelbrecht)\
**Post date:** [February 24, 2018, 5:55am UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/7 "2018-02-24T05:55:09Z")

</div>

Currently works for integers only  
😞

---

<div class="post-metadata">

**Author:** ![Renier\_Engelbrecht](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/renier_engelbrecht/32/15192_2.png) [@Renier\_Engelbrecht](https://community.thunkable.com/u/Renier_Engelbrecht)\
**Post date:** [February 24, 2018, 6:43am UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/8 "2018-02-24T06:43:22Z")

</div>

I got the function to work with decimal numbers as well. The code is long and does not fit a screenshot. Maybe someone can tell me how to export the code, that I can paste onto the board.  
Anyway here is a shared version  
[https://ios.thunkable.com/copy/5a91084bc570330001c22e18](https://ios.thunkable.com/copy/5a91084bc570330001c22e18)

---

<div class="post-metadata">

**Author:** ![waterlevelsense29bh7](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/waterlevelsense29bh7/32/74614_2.png) [@waterlevelsense29bh7](https://community.thunkable.com/u/waterlevelsense29bh7)\
**Post date:** [July 2, 2020, 4:47pm UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/9 "2020-07-02T16:47:15Z")

</div>

I added zero (0) with the input value, then assigned to a variable.  
Works for me! ![Capture](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/0/f0cb235603e44ed4bc893f23afea3b53ea2fc1d2.png)

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:25am UTC](https://community.thunkable.com/t/numbers-in-textinput-label/10282/10 "2024-11-08T11:25:09Z")

</div>


