# Trying to add number from Text Input

**URL:** <https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [June 7, 2020, 9:27pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837 "2020-06-07T21:27:44Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![iaia](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@iaia](https://community.thunkable.com/u/iaia)\
**Post date:** [June 7, 2020, 9:27pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/1 "2020-06-07T21:27:44Z")

</div>

![ForumThunkable2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/a/aab63d3b1d91ce4e9a5afcc4d74450cfbeff8f58.png)  
The thing that interests me most is to know why the sum of the label “LaTotal” gives me NaN, and why when you open the screen instead of the number the word total appears, but I would also like to know why what worked a few months ago (second image) now no longer works.  
 ![ForumThunkable3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/7/d7ed04532ad55fdadaf9702b6141b12e9c693d2a.png)  
I have already written a post for these blocks.

> [@Length of (the accounts don't come back)](http://community.thunkable.com/t/length-of-the-accounts-dont-come-back/588930):
>
> Because???

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 8, 2020, 6:32am UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/2 "2020-06-08T06:32:06Z")

</div>

NaN - not a number. This means that you are not trying to add numbers, but strings. If you add 1 + 1, it will be 2, and if “1” + 1 or " 1 " + “1”, it will be NaN. How do I add “1” + “1”? To do this, you need to convert a number in string form to a number, for example, using the addition block with 0.

![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/b/abfa05ee0fcf377e2fa6a4538c52036fd7b3c0d4.png)

---

<div class="post-metadata">

**Author:** ![maxb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maxb/32/35200_2.png) [@maxb](https://community.thunkable.com/u/maxb)\
**Post date:** [June 8, 2020, 8:32am UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/3 "2020-06-08T08:32:49Z")

</div>

That’s interesting,  
what does 2e2 convert to? Exponential? 2 \* 2?

![text math](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/a/aa9c6d64c7902c847837bdfe139f1a0f281a0eee.png)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 8, 2020, 2:36pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/4 "2020-06-08T14:36:20Z")

</div>

“e” performs the operation of multiplying a number by 1 with the specified number of zeros.

2e2 = 2 \* 100 or analog ![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/8/78a35de2b40a76856640fe0db359b6e89f93355b.png)

3e5 = 3 \* 100000

1e-2 = 1/100 = 0.01

If you are interested, try this too

![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/67e448e9a170ff578e235d9b6c0dca08969934d3.png)

---

<div class="post-metadata">

**Author:** ![zbk0612eip8w](https://avatars.discourse-cdn.com/v4/letter/z/7ab992/32.png) [@zbk0612eip8w](https://community.thunkable.com/u/zbk0612eip8w)\
**Post date:** [June 10, 2020, 2:03pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/7 "2020-06-10T14:03:42Z")

</div>

Check if that two statements are numbers, if not it will give NaN. Both LaTotal and LaPartial must be numbers, otherwise it will give NaN.

BTW, this happened to me again. I used the way @actech suggested but still not working. I was trying to add scores, but it gives me NaN as a result of the score.

Edit i modified it but per it gives me 201 rather than 1

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 10, 2020, 2:24pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/8 "2020-06-10T14:24:41Z")

</div>

Can you show me a project or blocks where my method doesn’t work? I don’t want to sound too cool, but my method should work well if the system is updated, there are no bugs, and the method is used correctly.

---

<div class="post-metadata">

**Author:** ![zbk0612eip8w](https://avatars.discourse-cdn.com/v4/letter/z/7ab992/32.png) [@zbk0612eip8w](https://community.thunkable.com/u/zbk0612eip8w)\
**Post date:** [June 10, 2020, 2:25pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/9 "2020-06-10T14:25:49Z")

</div>

it now works but weird as it sometimes work and sometimes dont

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 10, 2020, 2:30pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/10 "2020-06-10T14:30:11Z")

</div>

If this is the case, then you have an accidental error - this is a very unpleasant error that must be fixed. Imagine that your car’s brakes are working and not working. I would never drive a car like this.

---

<div class="post-metadata">

**Author:** ![zbk0612eip8w](https://avatars.discourse-cdn.com/v4/letter/z/7ab992/32.png) [@zbk0612eip8w](https://community.thunkable.com/u/zbk0612eip8w)\
**Post date:** [June 10, 2020, 2:31pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/11 "2020-06-10T14:31:21Z")

</div>

agree, contact thunkable support but i don’t know where

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 10, 2020, 2:36pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/12 "2020-06-10T14:36:01Z")

</div>

I can’t do this because I don’t see a problem. I can only see the problem if I run the project and see it on the screen of my device. Can you give a simple example of what doesn’t work?

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [June 10, 2020, 2:45pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/13 "2020-06-10T14:45:28Z")

</div>

> [@iaia](#):
>
> The thing that interests me most is to know why the sum of the label “LaTotal” gives me NaN, and why when you open the screen instead of the number the word total appears, but I would also like to know why what worked a few months ago (second image) now no longer works.

@iaia are the text\_inputs given a starting value somewhere or is there a chance that their initial value is “undefined”?

* * *

> [@zbk0612eip8w](#):
>
> BTW, this happened to me again.

What blocks are you using @zbk0612eip8w?

Thanks

---

<div class="post-metadata">

**Author:** ![zbk0612eip8w](https://avatars.discourse-cdn.com/v4/letter/z/7ab992/32.png) [@zbk0612eip8w](https://community.thunkable.com/u/zbk0612eip8w)\
**Post date:** [June 10, 2020, 2:46pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/14 "2020-06-10T14:46:24Z")

</div>

im using a score for that block in the quiz app remix

---

<div class="post-metadata">

**Author:** ![maxb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maxb/32/35200_2.png) [@maxb](https://community.thunkable.com/u/maxb)\
**Post date:** [June 10, 2020, 8:46pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/16 "2020-06-10T20:46:33Z")

</div>

_ **FIXED** _  
**the problem was in a ghost entry in the database that I didn’t know how to delete  
(right click on it → remove row) that affected the operations**

I’m having a similar issue with the sum of list

![sum of database list](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/6/4616e7e4aadface60188f038d0682052e3c30db1.png)

it **gives a string sum and not a numerical one** , the starting value of the label is zero (number), then it’s added one by one with every click, multiplied with database stored variable, the result is stored in the database and the list is the result of those. It used to work but now it does not.  
I’ve tried @actech’s +0 and it does work, but since i use only positive numbers I use the command “absolute” which takes the value of the number without the positive or negative otherwise it won’t work

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [June 10, 2020, 10:54pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/17 "2020-06-10T22:54:20Z")

</div>

if you can’t get a sum of list as you expect, it’s because the list is alphabetic (non numeric), try this for summing instead  
[https://x.thunkable.com/copy/b73c40571d5d6dd41b7580f752399b1d](https://x.thunkable.com/copy/b73c40571d5d6dd41b7580f752399b1d)

---

<div class="post-metadata">

**Author:** ![maxb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maxb/32/35200_2.png) [@maxb](https://community.thunkable.com/u/maxb)\
**Post date:** [June 11, 2020, 8:58am UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/18 "2020-06-11T08:58:25Z")

</div>

Thx, good to know, but I fortunately already solved my problem.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [June 11, 2020, 11:39am UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/19 "2020-06-11T11:39:08Z")

</div>

So it doesn’t work for you?

 ![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/a/0ac1a0e7fe0513868466bf4961eb7f2542f8711b.png)

---

<div class="post-metadata">

**Author:** ![maxb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/maxb/32/35200_2.png) [@maxb](https://community.thunkable.com/u/maxb)\
**Post date:** [June 11, 2020, 6:09pm UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/20 "2020-06-11T18:09:25Z")

</div>

> [@maxb](#):
>
> @actech’s method does work, but since i use only positive numbers I prefer to use the command “absolute” which takes the value of the number without the positive or negative, without the absolute, or actech’s method it would give a string sum and not a numerical one

I just found out this

---

<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:27am UTC](https://community.thunkable.com/t/trying-to-add-number-from-text-input/600837/21 "2024-11-08T11:27:09Z")

</div>


