Bug 325953 - rounding error when creating the transfer between two accounts in different currencies with option "to amount"
Summary: rounding error when creating the transfer between two accounts in different c...
Alias: None
Product: kmymoney
Classification: Unclassified
Component: general (show other bugs)
Version: 4.6.3
Platform: unspecified Linux
: NOR major (vote)
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
Depends on:
Reported: 2013-10-13 10:02 UTC by vy
Modified: 2013-12-27 12:09 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description vy 2013-10-13 10:02:39 UTC
the sum of transfer between two accounts in different currencies is being stored as a number calculated via exchange rate, despite option "to amount" was selected. For example when I get cash from my card account in ATM. If I withdraw 1234 currency1 units from my account  in other country in ATM as 6000 local currency2 units, I will create transfer in KMymoney from my card account into my cash account. I will  enter amount as 1234 in currency1 and select option "to amount" and enter amount as 6000 currency2. But KMymoney stores amount as 5 999,95 I think because it calculates amount with exchange rate instead of just storing it. Its obviously a bug because I get exactly 1234 currency1 units less on my account and I get exactly 6000 currency2 units in cash, but KMymoney refuses to store actual accounts states and this will lead to some unrecorded amounts which can be hard to trace later.

Reproducible: Always

Steps to Reproduce:
1. create some accounts in different currencies
2. create transfer between accounts with option "to amount", so that exact amount is not equal to that, calculated with exchange rate,

Actual Results:  
wrong amount stored.

Expected Results:  
Amount of transfer stored as entered.

Mark as major because accounting is a major feature of KMymoney. And errors in accounting is a major feature that is not working as expected.
Comment 1 vy 2013-10-16 07:20:30 UTC
Bug https://bugs.kde.org/show_bug.cgi?id=300965 may be related.
Comment 2 Markus Granzow 2013-12-27 09:41:39 UTC
It's really the same bug as in https://bugs.kde.org/show_bug.cgi?id=300965 , and still present in v. 4.6.4.
Comment 3 Thomas Baumgart 2013-12-27 12:09:46 UTC
Git commit 8901699c749384497fe6ee71309e868466c20e49 by Thomas Baumgart.
Committed on 27/12/2013 at 12:04.
Pushed by tbaumgart into branch 'master'.

Fix precision of price returned from price entry dialog

The returned price was truncated by the global price precision which
could cause all kinds of trouble when an amount was entered but the
price precision was not large enough to yield the same result in the
equation  result = amount / price * price;

Now the price is returned without precision loss in case it is based
on an amount (method is selected by the user in the dialog). In the
case the price is entered it is returned with the global price
precision in effect.
Related: bug 205254, bug 300965

M  +8    -9    kmymoney/dialogs/kcurrencycalculator.cpp
M  +12   -1    kmymoney/dialogs/kcurrencycalculator.h