Bug 117461 - rounding error in sum with currency rounding to 2 decimal places
Summary: rounding error in sum with currency rounding to 2 decimal places
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.0.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-06 15:22 UTC by internationils
Modified: 2018-05-06 15:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
xlsx file to reproduce the error (10.56 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-05-06 15:23 UTC, internationils
Details

Note You need to log in before you can comment on or make changes to this bug.
Description internationils 2018-05-06 15:22:02 UTC
Description:
I am calculating several numbers and then summing them. They are formatted to a currency (EUR). The sum is not correct, the last decimal of the sum (see cell in RED) should be a "5" and not a "6" according to the numbers that are summed (GREEN range).
Expected result: rounding done correctly wrt. number of decimal places so that numbers displayed are consistent and correct

Steps to Reproduce:
1. See attached spreadsheet
2. Bad sums can be reproduced with a different number of decimal places as well
3.

Actual Results:  
Sum with last decimal value of 6 instead of 5 (when summing the cents manually from what is displayed)

Expected Results:
Correct results... this kind of error is embarrassing in financial calculations that need to be presented.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 internationils 2018-05-06 15:23:42 UTC
Created attachment 141931 [details]
xlsx file to reproduce the error

xlsx file to reproduce the rounding error
Comment 2 m_a_riosv 2018-05-06 15:41:48 UTC
If you want the visual result it's used with their rounding there is an option on Menu/Tools/Options/LibreOffice/Calc/Calculate/General calculation -precision as show,
or use ROUND() function in every formula that should be rounded, I think the right way to have properly calculated the accounts, because some undesired effects can come from precision as show, for formulas where you need more precision than showed.

But there is not a bug