Bug 439861

Summary: Rounding error on investment transactions
Product: [Applications] kmymoney Reporter: bschnick
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 5.1.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 5.1.3
Attachments: screenshot of error

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