Bad math in exchange rates (transfer dialog)

Derek Atkins warlord at MIT.EDU
Sat Jul 12 11:07:51 CDT 2003


In all this you never state what version of GnuCash you are using.
However, I did test this with 1.8-CVS and the problem is still there.
Most likely the problem is that the rate calculations are limited to 6
decimal spaces, causing rounding to occur..

So, yes, please file a bug report.

-derek

Daniel Hannum <dhannum at magicdan.net> writes:

> Somebody let me know if I should file a bug. Gnucash appear to be
> doing its math wrong when you transfer money from a normal asset
> account (USD) to a stock asset account (with some other commodity)
> 
> 1. Make a new commodity
> 2. Make a new stock account that uses that commodity
> 3. Transfer money from any USD asset account to that stock account
> 4. Enter 6.50 as the amount
> 5. Set the accounts appropriate. The currency transfer part of the
> dialog will enable itself
> 6. Enter 0.644 as the 'to-amount'
> 7. Click back in the amount field and Gnucash will compute the price
> 8. Gnuash says that "1 foo = 10.092854 USD"
> 9. My calculator, however, says that the price should be 10.093168
> 
> That was a real world example. You might ask why I care about tenths
> of a cent. Here is a better contrived one that is obvious
> Enter 1746.08 as the amount
> Enter 56 as the 'to-amount'
> The price should be *exactly* 31.18, but Gnucash says 31.181790
> 
> If hit Ok, and then try to make another transfer of 31.18 (1
> share). Gnucash tries to help and puts "0.9999" in the to-amount box
> for me. So then I have to go in and fix it.
> 
> All of the stock accounts in question track commodities to 1/10000,
> which should be more than enough precision.
> 
> Thanks
> 
> dan
> 
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at lists.gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list