[Kmymoney-devel] [Bug 245214] New: A price precision of 9 and a fraction of 1000000 overflow the amount variable

Alvaro Soliverez asoliverez at gmail.com
Tue Jul 20 11:55:36 CEST 2010


https://bugs.kde.org/show_bug.cgi?id=245214

           Summary: A price precision of 9 and a fraction of 1000000
                    overflow the amount variable
           Product: kmymoney4
           Version: unspecified
          Platform: Archlinux Packages
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kmymoney-devel at kde.org
        ReportedBy: asoliverez at gmail.com


Version:           unspecified (using KDE 4.4.4) 
OS:                Linux

1- Create a new kmymoney file without any account.
2- Change the precision settings to 9 digits.
3- Create a new current account with 20,000.00 of opening balance.
3- Create a new investment account without an associated brokerage account.
4- Create a new investment (mutual fund), with fraction = 1000000 and Price
entry = "price per share". (do not use Finance quote)
5- Manually update the price for the newly created investment using the
following values:
date: 2010-07-08
price: 3,948476925

5- In the ledger view, buy shares for the new investment selecting the only
existent account, and with the following values:
date: 2010-07-08
Shares: 5065.244239
Price/share: 3.948476925

The total should be 20,000.00 (5065.244239 x 3.948476925 = 19,999.9999972), but
instead it shows: 1,553.255923 (1,553.26).

Anyway, finish the insertion of the transaction, and check the home view.
The investment has a balance of 1,553.26.

However, if you go to the reports view, and open the "Investment holding by
account" report, the total amount is correct (20,000.00).

6- Now edit the transaction in the ledger view, and change the ammount of
shares to 506,244239.
The total value is now correctly calculated (1,998.893696).

7- Reducing the fraction also results in the value being calculated correctly.


Reproducible: Always




OS: Linux (x86_64) release 2.6.34-ARCH
Compiler: gcc

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list