Even though humans look at this and know that 1.1 * 110
will result in an integer, the computer doesn’t know that. It knows that 1.1
is decimal and thinks that the result can be a decimal, and it is subject to the floating point precision issue.
Even though the currency formatting of ChargeX shows the number formatted nicely with two decimal places, it is still storing the calculated value with lots of decimal places. When another formula field references ChargeX, it uses the stored value, not the formatted value.
So, sadly, yes, if you are going to eventually concatenate the number with a string, you do have to manage number precision yourself. One option would be to use the ROUND()
function.
You can use it either when you do the initial calculation
ROUND(HowMany * Rate, 2)
or when you display, or anywhere else in the chain of formulas
ROUND(ChargeX, 2)
or use one of the pretty print routines.
Even though humans look at this and know that 1.1 * 110
will result in an integer, the computer doesn’t know that. It knows that 1.1
is decimal and thinks that the result can be a decimal, and it is subject to the floating point precision issue.
Even though the currency formatting of ChargeX shows the number formatted nicely with two decimal places, it is still storing the calculated value with lots of decimal places. When another formula field references ChargeX, it uses the stored value, not the formatted value.
So, sadly, yes, if you are going to eventually concatenate the number with a string, you do have to manage number precision yourself. One option would be to use the ROUND()
function.
You can use it either when you do the initial calculation
ROUND(HowMany * Rate, 2)
or when you display, or anywhere else in the chain of formulas
ROUND(ChargeX, 2)
or use one of the pretty print routines.
@kuovonne,
Once again I am in your debt. Thanks for this response.
I’m aware of the floating point issue. I’ve seen it (I think) in Excel and (IIRC) in SQL databases. On the other hand, I haven’t seen this problem in FileMaker or other apps that I work in for a long time.
And one thing I don’t understand is why this problem occurs in some calculations but not most. Consider the screenshot below. This is an unrepresentative sample of my base: this was a rare case where there were two problems on the same screen. What intrigues me is, virtually ALL of the charge values at the end of that calculated string are pulling data from the ChargeX field, which in turn in nearly all cases, is multiplying $110 by a decimal value like 0.9, 0.3, 0.5, 0.6, 1.4 and so on. *But the problem only occurs when the multiplier is 1.1. It does not occur with any other values as far as I can tell – including 2.1, 3.1, etc.
I understand the ROUND() function perfectly well but it’s kind of a pain to have to use it 100% of the time to solve a problem that only occurs slightly less than 5% of the time…
Anyway, I’ll do as you suggest. Thanks again for your generous help.
William
p.s. And thank you for the pretty print link! I’ve bookmarked and will read carefully later.

@kuovonne,
Once again I am in your debt. Thanks for this response.
I’m aware of the floating point issue. I’ve seen it (I think) in Excel and (IIRC) in SQL databases. On the other hand, I haven’t seen this problem in FileMaker or other apps that I work in for a long time.
And one thing I don’t understand is why this problem occurs in some calculations but not most. Consider the screenshot below. This is an unrepresentative sample of my base: this was a rare case where there were two problems on the same screen. What intrigues me is, virtually ALL of the charge values at the end of that calculated string are pulling data from the ChargeX field, which in turn in nearly all cases, is multiplying $110 by a decimal value like 0.9, 0.3, 0.5, 0.6, 1.4 and so on. *But the problem only occurs when the multiplier is 1.1. It does not occur with any other values as far as I can tell – including 2.1, 3.1, etc.
I understand the ROUND() function perfectly well but it’s kind of a pain to have to use it 100% of the time to solve a problem that only occurs slightly less than 5% of the time…
Anyway, I’ll do as you suggest. Thanks again for your generous help.
William
p.s. And thank you for the pretty print link! I’ve bookmarked and will read carefully later.

It just depends on the floating point precision error for that particular calculation.
If the value is 121.0001, you see the decimal. If the value would be 33.00000000000000000000000000000000000000000000000000000001 but Airtable doesn’t store that many decimal places, then you don’t see the problem.