# Math formula confusion

**URL:** https://forum.adalo.com/t/math-formula-confusion/2260
**Category:** Get Help
**Created:** [July 1, 2020, 8:45pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260 "2020-07-01T20:45:10Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 1, 2020, 8:45pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/1 "2020-07-01T20:45:10Z")

</div>

I am trying to have this application have 3 inputs, do a math equation then output a number. I am not exactly sure where to do this or how to do this. The math equation is ((x/1,000,000)\*y)\*3785 = Z. The other formula is (((x/1,000,000)\*y)\*3785)/v = Z. Where would I put these formulas and whats the best way to have the x, y, v values to be entered to where the app can do the math equation?

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 2, 2020, 12:47am UTC](https://forum.adalo.com/t/math-formula-confusion/2260/2 "2020-07-02T00:47:53Z")

</div>

Hi @Decon  
In your collection you can create properties X , Y and Z OF TYPE NUMBER / not text !!!  
next you can add a blank screen  
add 3 input fields named x,y,z - type NUMBER too…  
(you can se the default value to the database values - if existing - but not necessary for a test)

Add a button “titled : calculate button” for example  
in the button properties look for ADD ACTION  
in the action you should be able to find the “CREATE NEW formula” feature  
The Field to write the result to will be Z  
then clicking on the PEN in 3new formula RED “Oval” just write x/10000)\*…etc etc  
run Preview:  
fill up fields X and Y with some arbitrary values, then press the “calculation button”  
this will write the result in field Z

field names do not have to be the exact same name as your column names, but its better if you name them clearly so as not to confuse yourself…

There are slight modif but not really a best way until you know what and how you d want to feed your formula…  
and voila

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 2, 2020, 8:55pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/3 "2020-07-02T20:55:32Z")

</div>

Hello @bibipac I’m having a little bit of trouble. I believe I created the formula but I dont know how to write the formula to the to the Z field. I have the custom formula inputted but cant seem to figure this out. I am not sure what I am doing wrong

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 2, 2020, 9:04pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/4 "2020-07-02T21:04:42Z")

</div>

Yes, so the dif is that Adalo is not Excell, you do not writte the formula in the Z field.  
You writte it IN the Button you have to add…  
then each tyme that you will press this one, it will execute any formula and writte the result --\> to the Z field. Thats how it works in Adalo.

Make sure you use the ADD CREATE action to have access to Formulas you can modify as you wish…  
See pic  
you need to click on the Button to see the Menu for entenring the formulas  
Next you search for the Z field : this is where you will write your formula !

 ![Capture d’écran de 2020-07-02 11-02-57](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/6/6fb47f1e6bc301dd1cffa7c9f44d223925df8ab9.png)

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 2, 2020, 9:48pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/5 "2020-07-02T21:48:50Z")

</div>

When I go to put in a Form input all the options are blank.

 ![ss+(2020-07-02+at+02.48.24)](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/f/f2fff0ae4f7d424a8a0644a296944387cbb812e6.png)

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 2, 2020, 9:55pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/6 "2020-07-02T21:55:05Z")

</div>

I am trying to get it to output to the Ml/Min box but cant seem to get it to calculate or do that either.

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 2, 2020, 9:56pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/7 "2020-07-02T21:56:22Z")

</div>

correct, if you want to “link” each field to the DB, you can click on them “in the Screen layout” and insert the orignal field from the database…its on the right side (x\* or T\*).

But - normaly - since it you are in the CREATION Mode…  
it is also normal that all field start emtpy…

To test the button, did you enter a value in Dosage and in Flow… ?  
and then press Calculate ?  
What happened ?

\*Also, test it first with a simple formula i.e X x Y x 2  
When it displays fine, go for your final complex formula…its safer to debug.

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 2, 2020, 10:00pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/8 "2020-07-02T22:00:43Z")

</div>

![Capture d’écran de 2020-07-02 11-59-57](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/4/400dafc25a0c0633b4d629268901caa1676355fa.png) set type as Number…

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 2, 2020, 10:05pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/9 "2020-07-02T22:05:26Z")

</div>

I tried to calculate it and it inputted into the database as a zero. It would not do any formula for some reason.

 ![ss+(2020-07-02+at+03.05.06)](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/a/a6ec6ba04efdf987114b8a86c854f57e4fca5fca.png)

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 2, 2020, 10:19pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/10 "2020-07-02T22:19:53Z")

</div>

Good thing, you are on the right way !!! 👌  
just set so that the value of Z = X_10 and test again.  
if the correct values DOES NOT get registered it is then that the problems is in the formula syntax  
Not in adalo, start simple do not go for the final formula  
than modify it to be more and more complex  
things like () and operand +_- location are important if its not done well, you ll end up with Zeros…  
Also you need to write the Field INPUT names on their lines in the Button Script…I can see that you left them empty…or with INT(x) that is not enough…correct that too…they should appear in RED too

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 2, 2020, 11:10pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/11 "2020-07-02T23:10:29Z")

</div>

Also noted ; you have 2 fields mL/min.  
try to delete 1 or rename the other  
when renaming do not use symbols such as “/” or dots or “:”  
keep names simple surch as letters spaces …and numbers (maybe)

“mL per Min” is better

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 7, 2020, 8:38pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/12 "2020-07-07T20:38:55Z")

</div>

I got the math formula to work but now I am running into an issue where i cant put a % in a decimal point. The formula will only read up to 0.0 when I need it to read as small as 0.0000.

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 7, 2020, 11:29pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/13 "2020-07-07T23:29:49Z")

</div>

you can read more digits, I remember doing a \* of 2 numbers and getting 4 or 5 digits after.

> [@Help : How to keep only last 2 digits ? 7408."83"](https://forum.adalo.com/t/help-how-to-keep-only-last-2-digits-7408-83/1971):
>
> [abs result] For non-currencies calculating: Using ABS(), How to display this A\*B results (multiply) such as: 7408.82 ? or 7408.83 (rounding only at the 2nd digit level which seems appropriate) \*ROUND() would just remove anything after the dot (7409) face_with_raised_eyebrow thanks for any tips wink Any ROUND(A\*B.2) on the roadmap ? \*2 = last digits (result is fine but only when used with a Currency formats)

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 8, 2020, 3:22pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/14 "2020-07-08T15:22:17Z")

</div>

For some reason when I do the formula it cant cant read a 0.03 input which is what i need because it is in a percentage form. It will read the .3 but whenever I put .03 or .003 it will not read the decimal and calculate it. Do you know if there is a way to fix this?

 ![Screen Shot 2020-07-08 at 8.20.38 AM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/0/04cfa274e6a26e5ff196a9a0a89cb293390712e3.png) ![Screen Shot 2020-07-08 at 8.20.30 AM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/8/815b49334fbb96d330a3a910f191cf6921c1e747.png)

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 8, 2020, 5:15pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/15 "2020-07-08T17:15:39Z")

</div>

if its always going to be “0” you could use the prefix feature before .03, but I guess its just a format choice and should be able to display full number such as “0.003” …have you tested the other numbers formats or just use the “normal” format ?

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 8, 2020, 5:18pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/16 "2020-07-08T17:18:06Z")

</div>

Ive tried the number format and the normal format but it couldnt read either of them.

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 8, 2020, 5:43pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/17 "2020-07-08T17:43:32Z")

</div>

1 / 1000 = 0.001  
Field format is Number, maybe something IN your formula is asking adalo NOT to display the 0.\*\*\*  
 ![Capture d’écran de 2020-07-08 07-41-22](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/c/caa8487e7f43177ffded77d4b3f6582a9f6f31c9.png)

![Capture d’écran de 2020-07-08 07-44-25](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/a/a77c80d71ae1057beeb3fc2eda967be38d730db8.png)

---

<div class="post-metadata">

### Author: ![bibipac](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/bibipac/32/786_2.png) [@bibipac](https://forum.adalo.com/u/bibipac)
#### Post date: [July 9, 2020, 3:17am UTC](https://forum.adalo.com/t/math-formula-confusion/2260/18 "2020-07-09T03:17:42Z")

</div>

Did you succeed yet ? if no …share your formula here…I ll run it on my side. 🤷‍♂️

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 9, 2020, 2:35pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/19 "2020-07-09T14:35:13Z")

</div>

I did not get it to work.

 ![Screen Shot 2020-07-09 at 7.34.23 AM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/7/7bd2155c8d5e48152043f50cd7c707950dff7e21.png)

---

<div class="post-metadata">

### Author: ![Decon](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@Decon](https://forum.adalo.com/u/Decon)
#### Post date: [July 9, 2020, 3:46pm UTC](https://forum.adalo.com/t/math-formula-confusion/2260/20 "2020-07-09T15:46:45Z")

</div>

For some reason I cant get it to read the .03 in the % solution area.

[Next page](https://forum.adalo.com/t/math-formula-confusion/2260.md?page=2)
