# Math formula confusion

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?

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

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

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 !

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

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.

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.

set type as Numberâ€¦

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

Good thing, you are on the right way !!!
just set so that the value of Z = X10 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

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

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.

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

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?

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 ?

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

1 / 1000 = 0.001
Field format is Number, maybe something IN your formula is asking adalo NOT to display the 0.***

Did you succeed yet ? if no â€¦share your formula hereâ€¦I ll run it on my side.

I did not get it to work.

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