# Need help converting this equation into Thunkable Blocks

**URL:** <https://community.thunkable.com/t/need-help-converting-this-equation-into-thunkable-blocks/2424498>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, help, math, blocks\
**Created:** [May 18, 2023, 1:00pm UTC](https://community.thunkable.com/t/need-help-converting-this-equation-into-thunkable-blocks/2424498 "2023-05-18T13:00:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yohan.miranda130405v](https://avatars.discourse-cdn.com/v4/letter/y/dc4da7/32.png) [@yohan.miranda130405v](https://community.thunkable.com/u/yohan.miranda130405v)\
**Post date:** [May 18, 2023, 1:00pm UTC](https://community.thunkable.com/t/need-help-converting-this-equation-into-thunkable-blocks/2424498/1 "2023-05-18T13:00:39Z")

</div>

I am currently trying to create a block that contains a math equation. The problem is I do not know how to convert the equation below into blocks.

monthlyPayment = (loanAmount - downPayment + (loanAmount \* (interestRate / 100) \* loanTerm)) / loanTerm

---

<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:** [May 18, 2023, 2:38pm UTC](https://community.thunkable.com/t/need-help-converting-this-equation-into-thunkable-blocks/2424498/2 "2023-05-18T14:38:00Z")

</div>

What have you tried? Post a link to a project with blocks you’ve attempted and someone can suggest a fix. You’ll need a variable for each item (for example, loanAmount).

---

<div class="post-metadata">

**Author:** ![yohan.miranda130405v](https://avatars.discourse-cdn.com/v4/letter/y/dc4da7/32.png) [@yohan.miranda130405v](https://community.thunkable.com/u/yohan.miranda130405v)\
**Post date:** [May 18, 2023, 10:34pm UTC](https://community.thunkable.com/t/need-help-converting-this-equation-into-thunkable-blocks/2424498/3 "2023-05-18T22:34:00Z")

</div>

This is the best that I’ve tried.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/4/04e857f7d00c6a32dbf81869b3f14e27c5847862.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:** [May 18, 2023, 10:39pm UTC](https://community.thunkable.com/t/need-help-converting-this-equation-into-thunkable-blocks/2424498/4 "2023-05-18T22:39:09Z")

</div>

That’s hard to check carefully and you didn’t post a link to the project so I can’t make changes for you.

Here’s what I would suggest:

1. Separate out parts of the equation. So if your equation was, say, y=(2x-3)/2… then you could set a variable called numerator to 2x-3 and set a variable called denominator to 2 and then set a variable called y to numerator ÷ denominator. Pulling the equation apart like that can make debugging it very simple.

2. This is more of an aside but… _stored_ variables are slow in Thunkable. I recommend – if speed matters at all here – to use _app_ variables and only use stored variables when setting/changing a variable’s value. So when the screen opens, you would set each app variable to its stored variable partner and then use app variables throughout your blocks. When setting the final value of the equation, you would want to use a stored variable at that point.

---

<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:** [August 16, 2023, 10:39pm UTC](https://community.thunkable.com/t/need-help-converting-this-equation-into-thunkable-blocks/2424498/5 "2023-08-16T22:39:24Z")

</div>

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