Bug 439861 - Rounding error on investment transactions
Summary: Rounding error on investment transactions
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-15 02:56 UTC by bschnick
Modified: 2021-07-15 06:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 5.1.3
Sentry Crash Report:


Attachments
screenshot of error (72.31 KB, image/jpeg)
2021-07-15 02:56 UTC, bschnick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bschnick 2021-07-15 02:56:08 UTC
Created attachment 140065 [details]
screenshot of error

SUMMARY
Having problem entering some investment transactions.  There is a slight difference between the total amount shown in the transaction editing window and the total amount shown in the ledger.  Does not occur very often.  Only appears to occur with certain security.  


STEPS TO REPRODUCE
1. Create sell shares transaction
2. Set shares at 0.04348.  Set price at 197.78.
3. Total amount is shown as $8.60.  However when I press enter the ledger indicates total amount as $8.59.

OBSERVED RESULT
Entering shares at 0.04348 and price at 197.78 total amount in editing window is $8.60 but total amount shown in ledger is $8.59.  

EXPECTED RESULT
Amount in ledger to match amount in transaction editing window.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Have fraction for shares set at 1/100000 and have tried price precision of 2,3,4,5 and 6.  Same result regardless of price precision.
Comment 1 Thomas Baumgart 2021-07-15 06:21:56 UTC
Git commit 314fcbeea70d4d9d8e0acb98f6adffd78c988dd3 by Thomas Baumgart.
Committed on 15/07/2021 at 06:21.
Pushed by tbaumgart into branch '5.1'.

Fix rounding problem when entering investment transactions
FIXED-IN: 5.1.3

M  +6    -6    kmymoney/dialogs/investactivities.cpp

https://invent.kde.org/office/kmymoney/commit/314fcbeea70d4d9d8e0acb98f6adffd78c988dd3