Bug 75987 - EDITING: When calculating decimal values by monetary values, gives incorrect product
Summary: EDITING: When calculating decimal values by monetary values, gives incorrect ...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.2.3 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-10 16:21 UTC by Steven Shelton
Modified: 2014-03-11 00:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of payroll spreadsheet showing incorrect calculations (16.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-03-10 16:21 UTC, Steven Shelton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Shelton 2014-03-10 16:21:08 UTC
Created attachment 95514 [details]
Example of payroll spreadsheet showing incorrect calculations

Problem description: 
Doing a payroll spreadsheet in Calc. Times are calculated in 10 minute increments. Employee is paid $10 per hour. If employee works 19.67 hours, the total should be $196.70. Instead, Calc calculates the pay as $196.67.

Steps to reproduce:
1. Create a spreadsheet. Set up columns for beginning time and ending time (as time values), and for the total time expressed as a decimal value: (EndTime-StartTime)*24.

2. Set a cell to contain the hourly pay rate, expressed as dollars (in this case, $10)

3. Set a cell to calculate the total hours worked (i.e., "=SUM(E14:E22)")

4. Set a cell to calculate the total pay, referencing the cells described in steps 2 and 3 above.


Current behavior:
If the total hours worked are 19.67 and the pay rate is $10/hour, the total pay should be calculated as $196.70. Instead, the total pay is calculated as $196.67.

Expected behavior:
The total pay should be calculated as $196.70 (the correct value).
              
Operating System: Windows 8
Version: 4.1.2.3 release
Comment 1 m_a_riosv 2014-03-10 22:23:43 UTC
Hi Steven,
Values in total hours have more than 2 decimals, add more decimals to the format in E14:E22 and in B23, so you can see what is happening.

Using the ROUND() function can be useful to get what you want.

I think there is not a bug.

Changed status to Resolved Notabug. If you are not agree, please reopen it.