[Kmymoney-devel] Looking for the code for creating a balance

aga agander93 at gmail.com
Fri Sep 30 22:48:53 UTC 2011


On Fri, 30 Sep 2011 17:48:24 -0400
"Eric A. Bonney" <mailinglists at vanhlebarsoftware.com> wrote:

> I am trying to find the code for where a balance for an account is 
> created. Looking at the raw data it is tough to see any kind of
> pattern and I was hoping that looking at the code itself would help
> me in making sure that I am putting the correct value into that
> column.
> 
> Example:
>      If the balance for an account is 0.00 it appears that KMM stores 
> this in the balance column as 0/1, yet if the balance is $127.56 I
> see this stored as 3189/25. If a balance of an account is say just
> $24 then it seems to be stored as 24/1.
> 
> Hoping maybe either the code will give me a better understanding or 
> maybe someone on the list can help me understand how to determine the 
> value to be properly put into the column based on what I have from
> the user.
> 
> Thanks,
> -Eric
> _______________________________________________

Pending an expert response, have you looked into MyMoneyMoney()?

MyMoneyMoney price = MyMoneyMoney(txt) converts a text value to the KMM
internal equivalent, I think to avoid rounding problems that appear
with decimals.

If that's not what you're looking for, just ignore it.

Allan


More information about the KMyMoney-devel mailing list