Exact mathematical results

I'm having issues with the way the apps I create deliver the mathematical results. The problem is that it's rounding the results to my specifications, and I don't want that—I want the exact number. Help! How can I solve this? I need to get the exact results.
So in this case lets say that ENTRY is 0.03200954.
the result that it is giving is 0.03242 it represent the 1.1%
but if I make the requested math prioblem on the phone calculator it will shows me: 0.032416354 and this represent exactly 1.0%

Note that 0.01 is the 1% of ENTRY

Welcome Abraham.

Then do not specify rounding. :astonished: to your specification. How do you do this?

Perhaps you need to format the results to a number of decimal places.

Consider, some math operations do not have an exact answer. A case in point is 2 divided by 3 ( 0.66666666666 where the 6 keeps repeating forever ).

Please post your Blocks to get specific advice and/or get the advice from the documentation Math blocks

(Canned Reply: ABG - Download those blocks and post them here)

Please download and post each of those event block(s)/procedures here ...
P.S. These blocks can be dragged directly into your Blocks Editor workspace.

See Download Block Images for a demo.

Could you please recheck?

Without a Format block the multiply displays only five decimal precision, so to get the results you want, specify the number of decimal places. :astonished:

1 Like

Passing a numerical result through a text display field can lose precision.

Keep values in variables until they need to be displayed, then format them as needed.

Regarding that 0.01 multiplier, did you know that AI2 has an internal data type for rational numbers, where it keeps integral numerators and denominators until it is forced to switch to floating point.

So instead of
x = x + (.01 * x)
x = (101/100) * x

Please change 0.01 for 0.02 it will give you 0.0327354 what is the 1.99% and as you go further, like 0.05 the % result will be 4.86 and it should be 5% exactly. and I dont know why

I have diferente level like this, from 0.01 to 0.05 and as the % gratually decreases

I will try that

No, it does not do that Abraham. If you use 0.02 as the multiplier you get 0.000640190800000 when you format.

Sorry, but could you please make the equation with exactly the numbers I previous said: 0.03200954.

Look, it does not change the XXXXX54XXX, why? Sorry to bother you and I would like to say that I really appreciate your help. it seems to be working only with the first 6 digits


Depends on what your formula is and how you arranged your Blocks and you did not share that clearly.

here it is

I fixed it

1 Like

How did you fix it ? This may help others with the same problem.

My bad, it was just a math problem and @SteveJG was really helpful

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