MASSIVE round() bug

Please watch the video. ROUND() precision problem. https://youtu.be/Qg3eWC104c4

ODF file in question https://mega.nz/file/WyYhHCTC#XxMHXwC...

edit retag close merge delete

If you have to report a bug - turn to https://bugs.documentfoundation.org/ - or provide an example file showing the "bug" so anybody could have a chance to reproduce your "bug". Watching a blurry video definitely won't help to find out what's going on.

( 2020-12-01 12:51:23 +0200 )edit

Please upload an ODF type sample document here.

( 2020-12-01 13:00:12 +0200 )edit

I have uploaded the ODF file here, please take a look. https://mega.nz/file/WyYhHCTC#XxMHXwC...

( 2020-12-01 13:08:43 +0200 )edit

Data>Calculate>Recalculate or F9 does also the trick.

( 2020-12-01 13:35:30 +0200 )edit

Reference information: OP reported tdf#138595 (from my perspective not a bug).

( 2020-12-01 17:30:11 +0200 )edit

Sort by » oldest newest most voted

Hello,

your problem is "accumulating" rounding errors. If you are performing calculation with currencies, you need to round each value to 2 decimal digits: But you perform:

in C38: =B38*$K$2/8*24 instead of =ROUND(B38*$K$2/8*24;2)
in G38: =F38*$K$2/8*24 instead of =ROUND(F38*$K$2/8*24;2)
in N38: =M38*$K$2/8*1,5*24 instead of =ROUND(M38*$K$2/8*1,5*24;2)

and at the end you get unpredictable results (though I admit that it is not clear [at least to me], why there is absolutely no indication of that).

more

C38, Employee earns THB51 per hour, and has worked for 56 hours. Results in EXACTLY 2856.00

N38, Employee earns 1.5 times the normal working hour for overtime,(51*1.5=76.5). Has worked for 13 hours. Results in EXACTLY 994.50

Q38, Total employee earning, 2856.00+994.50 = EXACTLY 3850.50

R38, 57.00 subtracted from total earnings

S38, Net earning, is 3850.50 minus 57.00. Results in EXACTLY 3793.50

I don't see anywhere that any rounding errors could accumulate?

( 2020-12-07 12:17:38 +0200 )edit

From where did you read that you could see it? - my answer is about experience and testing your file and (little) knowledge of IEEE 754 floating point aritmetic.

( 2020-12-07 12:48:54 +0200 )edit

Stats

Asked: 2020-12-01 12:36:51 +0200

Seen: 71 times

Last updated: Dec 01 '20