# \[Solved\] My stored variable keeps showing NaN

**URL:** <https://community.thunkable.com/t/solved-my-stored-variable-keeps-showing-nan/864139>\
**Category:** Questions about Thunkable X\
**Tags:** solved, stored-variable\
**Created:** [October 1, 2020, 2:27am UTC](https://community.thunkable.com/t/solved-my-stored-variable-keeps-showing-nan/864139 "2020-10-01T02:27:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adiyy.khanic22](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@adiyy.khanic22](https://community.thunkable.com/u/adiyy.khanic22)\
**Post date:** [October 1, 2020, 2:27am UTC](https://community.thunkable.com/t/solved-my-stored-variable-keeps-showing-nan/864139/1 "2020-10-01T02:27:44Z")

</div>

Hi i need to use thunkable for a school project, only problem is my teachers dont know a thing about thunkable so i’m turning to this forum. i have my code in the image and i need the app cost to show up on the order total label

 ![Screenshot 2020-10-01 114139](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/0/703e471c571597b901760e0d05be0908844f9d1d.png) ![Screenshot 2020-10-01 122309](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/2/027eabd0efb606298065765a422acb4822d10036.png) ![Screenshot 2020-10-01 122334](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/7/a793c5147e79a198bfeb28bae014418931982847.png) , however it shows NaN instead, how do i fix this, thanks!

---

<div class="post-metadata">

**Author:** ![roumak-coder](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@roumak-coder](https://community.thunkable.com/u/roumak-coder)\
**Post date:** [October 1, 2020, 3:30am UTC](https://community.thunkable.com/t/solved-my-stored-variable-keeps-showing-nan/864139/2 "2020-10-01T03:30:45Z")

</div>

Why are you using stored variables?

---

<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 1, 2020, 4:11am UTC](https://community.thunkable.com/t/solved-my-stored-variable-keeps-showing-nan/864139/3 "2020-10-01T04:11:41Z")

</div>

The code looks good. I’m not sure why you’re getting NaN for your total. If you want to share the link to your project, I can take a look and see if there’s some other reason it’s not working right.

If you stick with Thunkable, you may want to look into local databases and tables/spreadsheets. It can make your coding much more efficient.

---

<div class="post-metadata">

**Author:** ![thanos-x](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/thanos-x/32/91404_2.png) [@thanos-x](https://community.thunkable.com/u/thanos-x)\
**Post date:** [October 1, 2020, 8:34am UTC](https://community.thunkable.com/t/solved-my-stored-variable-keeps-showing-nan/864139/4 "2020-10-01T08:34:57Z")

</div>

Hey @adiyy.khanic22, try changing app var to stored var that sorted me out when I had those issues.

---

<div class="post-metadata">

**Author:** ![Michael\_Rogulla](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michael\_Rogulla](https://community.thunkable.com/u/Michael_Rogulla)\
**Post date:** [October 1, 2020, 8:42am UTC](https://community.thunkable.com/t/solved-my-stored-variable-keeps-showing-nan/864139/5 "2020-10-01T08:42:32Z")

</div>

Hi @adiyy.khanic22,

when you use a “stored” variable it is “undefined” at the beginning. And when you add a value to it, it keeps being undefined. So just enter a block to set it to a starting value like this:

![grafik](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/c/cccc59d2102999ee8de09fafcf910c31a09befc7.png)

- Be shure to use the Block “Screen1.Starts”, and **not** “Screen1.Opens”
- if you change the type of score from “stored” to “app” then things are easier, but the value will get lost after closing the app. A “stored” variable will be present the next time you start the app.

---

<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, 12:23pm UTC](https://community.thunkable.com/t/solved-my-stored-variable-keeps-showing-nan/864139/6 "2024-11-08T12:23:43Z")

</div>


