Skip to main content
Solved

Why isn't this 0? What is it


Forum|alt.badge.img+9

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

Best answer by kuovonne

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.

View original
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+17

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.


Forum|alt.badge.img+9
  • Author
  • Known Participant
  • 19 replies
  • April 15, 2022
Dominik_Bosnjak wrote:

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


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6002 replies
  • Answer
  • April 15, 2022

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.


Forum|alt.badge.img+19
  • Inspiring
  • 3264 replies
  • April 16, 2022
kuovonne wrote:

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.


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


Reply