Bad math in exchange rates (transfer dialog)

Daniel Hannum dhannum at magicdan.net
Sat Jul 12 21:26:09 CDT 2003


sorry. I noticed it in 1.8.1 and I specifically checked CVS to see if it 
was fixed (there was a changelog entry:

Fix the transfer dialog / exchange-rate dialog so it doesn't round
the values input by the user. (#106332)

And then I forgot to tell you that it was in CVS. My bad. I'll put in a 
bug report.

Derek Atkins wrote:

>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
>>    
>>
>
>  
>



More information about the gnucash-devel mailing list