Bug 501997 - When buying / selling shares for an investment, the value is rounded to two decimal places
Summary: When buying / selling shares for an investment, the value is rounded to two ...
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: ux-ui (show other bugs)
Version: git (master)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-25 20:51 UTC by Tony
Modified: 2025-03-30 20:16 UTC (History)
1 user (show)

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


Attachments
test file (10.87 KB, text/xml)
2025-03-25 21:10 UTC, Ralf Habacker
Details
Screenshot showing ledger for account 'Investment' (55.38 KB, image/png)
2025-03-25 21:12 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tony 2025-03-25 20:51:15 UTC
SUMMARY
This bug is identical to that reported in bug report 403249. It appears to be a regression.

STEPS TO REPRODUCE
1. Create a new security of type Stock having price precision of 4 and remainder of Round.
2. In the ledger, enter a Buy transaction of 70 shares and Price/share of 35.6550

OBSERVED RESULT
The Price/share changes to 35.65. The Total amount shows 2495.50

EXPECTED RESULT
The Price/share should show 35.655. The Total amount should show 2495.85.

SOFTWARE/OS VERSIONS
Windows 10
Ubuntu Linux
(I reproduced it on both platforms)

ADDITIONAL INFORMATION
KMyMoney version 5.1.92-bfd5a63 (from the Help/About KMyMoney menu)
KMyMoney build master 4183
Comment 1 Ralf Habacker 2025-03-25 21:10:51 UTC
Created attachment 179732 [details]
test file

With the appended test file the reported behavior cannot be reproduced. It includes two investment accounts: 'A' with a 4 digit price precision and 'B' with a 2 digit price precision. In the ledger for account 'Investment' the price is displayed as expected: 'A' with 4 digits and 'B' with 2 digits.
Comment 2 Ralf Habacker 2025-03-25 21:12:50 UTC
Created attachment 179733 [details]
Screenshot showing ledger for account 'Investment'
Comment 3 Tony 2025-03-25 21:40:27 UTC
Your test file works correctly as you stated. I deleted the Buy transaction and the security and recreated them and this time it behaved correctly as well. I suppose this case can be closed. If it happens to me again I'll try to determine the steps that reproduce the behaviour.
Comment 4 Jack 2025-03-30 20:16:57 UTC
Closing per Comment #3.