Help

ROUNDUP incorrect rounding - take 2

Topic Labels: Formulas
Solved
Jump to Solution
1084 6
cancel
Showing results for 
Search instead for 
Did you mean: 
Steve_Kiwi
6 - Interface Innovator
6 - Interface Innovator

ROUNDUP is returning unexpected results.

See screenshots, there are 3 records where ROUNDUP is increasing the value rather than truncating a '0' (I was expecting 0.070 roundup to be 0.07)  Is this an error, or am I not understanding ROUNDUP correctly?

2nd screenshot added the FLOOR function as suggested in this pos, but had no impact to the results.: Solved: Re: ROUNDUP(number, 2) Incorrect rounding - Airtable Community

thanks for any insights!

1 Solution

Accepted Solutions
BillFrench
7 - App Architect
7 - App Architect

All of them. This list demonstrates there is a preponderance of evidence that the Java floating point bug is what you may be encountering.

https://ellenaua.medium.com/floating-point-errors-in-javascript-node-js-21aadd897bf8

https://stackoverflow.com/questions/1458633/how-to-deal-with-floating-point-number-precision-in-java...

See Solution in Thread

6 Replies 6

The infamous Java floating point error?

Sho
11 - Venus
11 - Venus

Are the "Crate Weight" numbers rounded off by format?
That would also change the result.
But why does ROUNDUP turn 0.55000 into 0.56?
I don't usually use ROUNDUP so it's not a problem, but is this a bug?

How about this ugly workaround?

Cut off to 3 decimal place and rounded up to 2 decimal place
ROUNDUP(INT({Num}*1000),-1)/1000

Cut off to 4 decimal place and rounded up to 2 decimal place
ROUNDUP(INT({Num}*10000),-2)/10000

 

No, there doesn't seem to be one that would be helpful, but which one specifically?

BillFrench
7 - App Architect
7 - App Architect

All of them. This list demonstrates there is a preponderance of evidence that the Java floating point bug is what you may be encountering.

https://ellenaua.medium.com/floating-point-errors-in-javascript-node-js-21aadd897bf8

https://stackoverflow.com/questions/1458633/how-to-deal-with-floating-point-number-precision-in-java...

Thanks for the article! The Stackoverflow article was especially helpful.
I don't know much about programming so I didn't know it was a common problem.
In Airtable's case, it seems like a better way to calculate it as an integer for now.