This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[READABILITY IMPROVEMENT] Currency exchange rounding issues

Tags: None
(comma "," separated)
User avatar
JesusM
Registered Member
Posts
212
Karma
0
OS
Hi,

My main currency with Skrooge is EUR, but I also use other currencies like for example GBP. I don't usually have much money there and is mostly a transition account, meaning that most of the time the balance is 0. And here is when the 'issue' is visible:

Image

Here is the view of one of these accounts in the 'Accounts (Full)' widget, comparing current month with last month and with same month last year, and you can see, the balance is 0, but not exactly, so it shows '-0' and even it shows a change in the balance (2.20/0.97%).
Why is that? My guess, because the amount is stored with too many decimals, so maybe the actual balance is something like -0.00001GBP. And yes, I reckon I have Skrooge configured to use 6 decimals for GBP, but this is needed to have proper exchange rates. If I reduce it to just 2, the exchange rates would be too rough.
So, what can be done? This is not a big problem, but it looks annoying and inaccurate when showing the account balance.

My suggestion (assuming I am right with the root cause): differentiate the number of decimals to be used for exchange rates and for saving transactions, being independently configurable.

If this is too complex to do, other possibility, just cosmetic, would be to actually round the figures to 2 decimals when showing balances in the main currency.

Thanks
Alex Viv
Registered Member
Posts
1
Karma
0
Hi JM,

Your statement below is not correct:
I have Skrooge configured to use 6 decimals for GBP, but this is needed to have proper exchange rates.


There is something very misleading in Skrooge with currency exchange rates:
- Set GBP and EUR to 2 decimals
- Set GBP exchange rate to 1.1558 (when you save it will show 1.16)
- Add a transaction of 1000 GBP
- It will show 1558 EUR in operations (not so sure in dashboard but it should be the same)
This is very misleading, when you enter exchange rate, it saves the value you entered with all decimals but it display following the number of decimals configured in Units
I know this because initially I raised a bug and Stephane clarified in the bug comments that it's not a bug: https://bugs.kde.org/show_bug.cgi?id=452697

Proposed solution 1 (rejected):
I did raised another bug (as a display bug: https://bugs.kde.org/show_bug.cgi?id=453466) to avoid this very misleading problem. The solution I proposed was to simply remove the display rounding only for exchange rate.
I was so sure this would be accepted that I even propose the code change in gitlab https://invent.kde.org/office/skrooge/-/merge_requests/17#note_445514.
But this was rejected by Stephane because of a more technical reason: in some cases (that I couldn't reproduce) if you remove the display rounding, the exchange rate would show 2.9999999999 instead of 3.0. To avoid this, Stephan prefers to keep the current behavior.

Proposed solution 2 (to be confirmed with Stephane):
Another solution we could propose to Stephane would be similar to what JM suggest: create a configuration to specify the number of decimals for currency (but it would still apply to the display only, which is still not ideal)

Stephane, when you read this, let us know if the above would be acceptable or if you have a better suggestion. But really the current way exchange rate display works is too misleading. Even experienced users like JM got it wrong.
Vivien
User avatar
JesusM
Registered Member
Posts
212
Karma
0
OS
Hi Alex,

Thanks for your comments. You are probably right that I don't really need to set GBP (or any other unit) to a number of decimals to get accurate exchange, and that I will get it right even if I set a lower number.

But the main issue remains, and I think it is for the same reason, it is very difficult to get an exact 0 at the end, so you can get what I showed in the original post.

Thanks


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]