Summary: | rounding errors in currency conversion of investment transactions | ||
---|---|---|---|
Product: | [Applications] kmymoney | Reporter: | Al <software> |
Component: | general | Assignee: | KMyMoney Devel Mailing List <kmymoney-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 5.1.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/office/kmymoney/commit/e9786584d3f23e168ec52029437bfcd46ca5f072 | Version Fixed In: | 5.1.2 |
Sentry Crash Report: | |||
Attachments: |
Minimal data file
Screenshot of conversion Dialog Minimal data file |
Description
Al
2018-07-08 14:47:40 UTC
Does this problem still exist in a recent version, such as 5.1.1? I don't know if this may have been addressed, but there were fixes related to some rounding issues. Hi Jack Thanks for looking into this. I tested on KMyMoney 5.1.0-1; this is the up-to-date version on the newest on Kubuntu 20.10. Outcome: the problem still persists. The deviation from the correct amount is slightly different, but still incorrect (the deviation is even larger then what I reported back in 2018). Can you provide a small kmy file which demonstrates the problem? I'm unable to duplicate this, although I may be using different currency for each account and category, and different number of decimal places for each account. Thanks. Please try entering the inverse conversion rate - instead of .008981 CHF per JPY try 111.35 JPY per CHF. I think there is limited precision of the stored conversion rate, so .008981 is only being stored as .0089. You can check that by looking at the Price Editor (menu item Tools/Prices) and looking at both JPY/CHF and CHF/JPY. Created attachment 136622 [details]
Minimal data file
Thanks, Jack. Attached the requested minimal data file. I have entered the same transaction twice: once using the JPY -> CHF conversion *rate*, once entering the converted CHF *amount* (see comments to the two transactions). Both time the amount in the bank account is inaccurate: 108.00 CHF, should be 108.48 CHF.
Created attachment 136623 [details]
Screenshot of conversion Dialog
Workaround was suggested to enter the inverted conversion rate. However, the conversion dialog does not have an option to use the inverted rate, see screenshot ConversionDialog.png
You have to use the Price Editor to enter the inverted conversion rate for that date, and do that before you enter the transaction. That's why you need to look at both conversion rated in the Price Editor to be sure there isn't a conflicting one already entered for that date. Created attachment 136629 [details]
Minimal data file
Attached the updated minimal data file. I have entered the same transaction three times: (1) using the pre-entered CHF -> JPY conversion rate; (2) using the JPY -> CHF conversion *rate*; (3) using the converted CHF *amount* (see comments to the three transactions). Each time the amount in the bank account is inaccurate: 108.00 CHF, should be 108.48 CHF.
Additionally, note that the conversion rate CHF -> JPY entered in the price editor (1/0.008539 = 117.109731819) is correct when looked up in the price editor (albeit rounded to 117.1097) but incorrect in the conversion dialog when entering a transaction: JPY -> CHF = 0.0085 and CHF -> JPY = 117.1341. The latter is 1/0.0085.
Git commit e9786584d3f23e168ec52029437bfcd46ca5f072 by Thomas Baumgart. Committed on 14/03/2021 at 09:02. Pushed by tbaumgart into branch '5.1'. Differentiate between trading currency and others If the trading currency of a security has a smaller fraction than the currencies of the other accounts in a transaction the values will be truncated. This change fixes the problem by using the fraction information from the account involved. FIXED-IN: 5.1.2 M +13 -9 kmymoney/dialogs/investtransactioneditor.cpp https://invent.kde.org/office/kmymoney/commit/e9786584d3f23e168ec52029437bfcd46ca5f072 |