I’m building some kind of ROI calculator, where I need to calculate a percentage value from one of the fields. I use this part of the formula in the calculation field: 1 - ({mtrjcv} / 100). For example, if the field input value equals 80 the calculation should be 1 - (80 / 100) = 0.2. Instead, I’m getting 0.19999999999999996 as a calculation field value.
I’m not good at math, so I used one of the online scientific calculators to check the formula and the result was 0.2. So my question is – Is this a bug or a feature? Thanks.
I have the same problem, its different output if you enable round value or enable currency format.
The same thing if you disable those 2. Its a headache. It needs to have suffixes before and after so we can add custom text like “$” etc.
@Daniele theres must a formatting styling for calculation fields
Yeah, you’re right. After publishing my YouTube tutorial, I noticed the issue when I retested the calculation. The divisions seem to perform some approximations somewhere.
This is a Javascript issue, most caculations with javascript need to use the rounding statement as because of the way javascript stores variables as binary floating-point aritmatic, these errors happen regularlly. (open dev tools, inspect, select console they type ‘console.log(1-(80/100))’ without the 's and you’ll see. Is there an option for the number of decimal places?