Bug 157082 - Calc Round Up is Rounding Down for some values
Summary: Calc Round Up is Rounding Down for some values
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2023-09-04 09:34 UTC by NOYB
Modified: 2023-10-19 14:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
LibreOffice Calc Round Up Errors Screen Capture (139.55 KB, image/jpeg)
2023-09-04 09:38 UTC, NOYB
Details
LibreOffice Calc Round Up Errors (positional) (144.20 KB, image/jpeg)
2023-09-04 23:04 UTC, NOYB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NOYB 2023-09-04 09:34:53 UTC
Description:
Round Up is Rounding Down
LibreOffice Calc 7.6.0.3
Formula: =ROUNDUP(0.276327000000664,6)
Actual   Result: 0.276327
Expected Result: 0.276328


Steps to Reproduce:
1. Formula: =ROUNDUP(0.276327000000664,6)
2.
3.

Actual Results:
0.276327

Expected Results:
0.276328


Reproducible: Always


User Profile Reset: No

Additional Info:
Round up error does not occur in MS Excel.
Comment 1 NOYB 2023-09-04 09:38:52 UTC
Created attachment 189334 [details]
LibreOffice Calc Round Up Errors Screen Capture
Comment 2 Eike Rathke 2023-09-04 10:52:12 UTC

*** This bug has been marked as a duplicate of bug 154792 ***
Comment 3 NOYB 2023-09-04 11:40:44 UTC
Precision of only 5 digits.  So pathetic.  And won't address it.
LOLSMH
Comment 4 NOYB 2023-09-04 23:02:14 UTC
Don't believe this duplicate of the 154792 issue.
This issue is seems to be with the digit position of the rounding.
i.e. Everything beyond the specified digit+1 is ignored (treated as all zeros; truncated prior to rounding).

Formula                         Actual Result       Expected Result     Difference
'=ROUNDUP(0.276327000000664,1)  0.300000000000000 0.300000000000000 
'=ROUNDUP(0.276327000000664,2)  0.280000000000000 0.280000000000000 
'=ROUNDUP(0.276327000000664,3)  0.277000000000000 0.277000000000000 
'=ROUNDUP(0.276327000000664,4)  0.276400000000000 0.276400000000000 
'=ROUNDUP(0.276327000000664,5)  0.276330000000000 0.276330000000000 
'=ROUNDUP(0.276327000000664,6)  0.276327000000000 0.276328000000000 -0.000001000000000
'=ROUNDUP(0.276327000000664,7)  0.276327000000000 0.276327100000000 -0.000000100000000
'=ROUNDUP(0.276327000000664,8)  0.276327000000000 0.276327010000000 -0.000000010000000
'=ROUNDUP(0.276327000000664,9)  0.276327000000000 0.276327001000000 -0.000000001000000
'=ROUNDUP(0.276327000000664,10) 0.276327000000000 0.276327000100000 -0.000000000100000
'=ROUNDUP(0.276327000000664,11) 0.276327000000000 0.276327000010000 -0.000000000010000
'=ROUNDUP(0.276327000000664,12) 0.276327000001000 0.276327000001000 
'=ROUNDUP(0.276327000000664,13) 0.276327000000700 0.276327000000700 
'=ROUNDUP(0.276327000000664,14) 0.276327000000670 0.276327000000670 
'=ROUNDUP(0.276327000000664,15) 0.276327000000664 0.276327000000664
Comment 5 NOYB 2023-09-04 23:04:17 UTC
Created attachment 189353 [details]
LibreOffice Calc Round Up Errors (positional)
Comment 6 ady 2023-09-05 06:50:46 UTC
(In reply to NOYB from comment #4)
> i.e. Everything beyond the specified digit+1 is ignored (treated as all
> zeros; truncated prior to rounding).

FWIW, that's not a completely accurate description. The value 0.276327000000664 requires 15 positions to the right of the decimal separator (which is a kind of limit for typical spreadsheet tools on common hardware); using a value of 14 decimal positions would have a different result in your test, and thus the aforementioned description would have to be expressed differently.