Why isn't this 0? What is it

Why isn’t this 0? What is it. Look at the picture for details

Looks like either a typing or formatting issue. Rollup fields return arrays by default, though that DHL field might also be returning a string.

Have you tried clicking the Formatting tab in the formula editor and setting the output to an integer?

Failing that, can you share the rollup formulas you’re subtracting? Wrapping both formulas in VALUE() calls can probably serve as a band-aid fix for this specific brand of type errors, but you should really look to fix the underlying mechanism. Trying to correct faulty formulas with more formulas is a recipe for developing bad habits and even worse-performing apps.

I have set the format, I also suspected that there is a very small decimal hidden here, but I save 8 decimal places, still can not find the problem. And all the other records that subtracted to zero were normal, just these two anomalies

It’s a known floating point issue. You can only see a set number of decimal places, but under the hood, Airtable is calculating more decimal places.

If you want it to be exactly zero, (without the minus), ROUND() the numbers. Note that you will still see however many decimal places you specify in the formatting options.

3 Likes

Yep, and it’s a long-standing issue in Airtable but we cannot blame Airtable; this is a common problem in many languages actually.

1 Like

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