# How to add modulo on calculator?

**URL:** https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677
**Category:** Questions about Thunkable X
**Tags:** beginner
**Created:** [July 24, 2023, 8:36am UTC](https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677 "2023-07-24T08:36:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![pratiwi.nurhayatiddy](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pratiwi.nurhayatiddy](https://community.thunkable.com/u/pratiwi.nurhayatiddy)
#### Post date: [July 24, 2023, 8:36am UTC](https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677/1 "2023-07-24T08:36:38Z")

</div>

Hello mate,

Could you please take a look with my problem? I can’t find the function for modulo. I try use remainder of block but the result always showing NaN. Thank you in advance

 ![thunkable issue](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/5/95310aefa6b1a2fc37c6cff88292632e435e8169.png)

---

<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: [July 24, 2023, 3:53pm UTC](https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677/2 "2023-07-24T15:53:57Z")

</div>

I thought maybe the problem was that you were trying to get the remainder of a text string divided by a text string rather than numbers. But this test worked so that isn’t the problem:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/8/38e7c171b19d4af9ba2971562076afaeb0d25edf.png)

You’re either dividing by zero or you’re getting extra characters in your variables.

What are you doing to verify that all of your variables have the values you expect them to have? I would recommend that when you display the variables in a label, you join a character before and after the value so that something like " 3" becomes • 3•, that way you can see the space in the result.

If that still doesn’t fix the problem, post a link to the project.

---

<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: [July 25, 2023, 7:09am UTC](https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677/3 "2023-07-25T07:09:32Z")

</div>

the way you are parsing is not correct. if you call it a modulo function, it usually takes the form of mod(11,7) but your parsing blocks seem to assume that operation is infix type - ie.  
`11 mod 7`  
if you expetc tthe statement this way, you may get the 1st variable correctly because it’s fond to he left of ‘mod’ but that parsing for the 2nd variableis not correct because you are start counting after the first letter of ‘mod’.  
if you still prefer the function to be written in infix notation instead of as a procedure , you may want to use  
`%` to avoid confusion . thus the above example would be  
`11 % 7`  
instead of  
11 mod 7

iif you want ot be consistent and use the mod(11,7) notation - you have to set up a different method of parsing.- locate “mod”,find the parenthesis pair , split the text between using a comma.

---

<div class="post-metadata">

### Author: ![pratiwi.nurhayatiddy](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pratiwi.nurhayatiddy](https://community.thunkable.com/u/pratiwi.nurhayatiddy)
#### Post date: [July 26, 2023, 8:31am UTC](https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677/4 "2023-07-26T08:31:30Z")

</div>

Thank you for solution Mr.Tatiang, It’s work

---

<div class="post-metadata">

### Author: ![pratiwi.nurhayatiddy](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@pratiwi.nurhayatiddy](https://community.thunkable.com/u/pratiwi.nurhayatiddy)
#### Post date: [July 26, 2023, 8:32am UTC](https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677/5 "2023-07-26T08:32:22Z")

</div>

Thank you Mr. manyone

---

<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: [July 26, 2023, 9:48am UTC](https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677/6 "2023-07-26T09:48:48Z")

</div>

How did you fix the problem?

---

<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: [October 24, 2023, 9:49am UTC](https://community.thunkable.com/t/how-to-add-modulo-on-calculator/2517677/7 "2023-10-24T09:49:08Z")

</div>

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