[Kmymoney-devel] [Android Port] Help with computing the account balance

Eric Bonney mailinglists at vanhlebarsoftware.com
Thu Oct 4 16:05:05 UTC 2012


So after working with Martin and doing some testing of a build trying to
use EURO instead of USD a number of poor design choices have come to light.
I am trying to work through them and hopefully make the app more
international friendly in the process.

One of the choices that I made early on was to do all of my calculations
based off the balanceFormatted column for accounts and splits. Well this
was all fine when all I was dealing with was USD based files, but it fails
miserably when trying to use something else.

So I know that the balance column is a fraction which I am assuming is the
greatest common denominator of the actually value over 100??

Example: value is $150.00 so the balance column is the GCD of 150/100?

So, if that is correct, I believe I have found routines to help me
calculate the GCD properly, but my question is how do you then later take
this fraction and inflate it back to the correct value? I am trying to get
away from having my application rely on the balanceFormatted column as much
as possible because it is causing me headaches and if the balance column is
the best and more accurate column to be using then I want to.

I have tried to look at the code to see where this but I can't see it. I
think I recall in the past when I asked about this, that it was actually
being handled by an outside library right? Does anyone have any suggestions
or pointers as to where I can look so that I can move my application into a
better design to work more closely the way KMM works with the data?

Thanks,
-Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20121004/b186c6c5/attachment.html>


More information about the KMyMoney-devel mailing list