Ping: Re: [patch] FIx loan druid when auto_decimal is enabled

Derek Atkins warlord at MIT.EDU
Sun Mar 25 15:53:42 EDT 2007


I haven't.  I don't know if Josh has.  Has anyone tested this patch?
Have you?  Does it work?

-derek

Jerry Quinn <jlquinn at optonline.net> writes:

> Hi, all.  Has anyone had a chance to look at this patch yet?
>
> Thanks,
> Jerry Quinn
>
>
> Jerry Quinn wrote:
>> Hi, folks.
>> 
>> This patch fixes #343795 for me.
>> 
>> This patch makes the loan druid generate correct loan amortization numbers 
>> when auto_decimal is turned on.  The problem is that the formulas use "12" as 
>> the number of periods inside the text string, rather than "12.0".  The text 
>> parser turns it into a number, applies auto_decimal, and creates 12/100, which 
>> then screws up the remaining computations.
>> 
>> This bug has been around and biting me for a long time, since version 1.8 when Jerry Quinn <jlquinn at optonline.net>
>> I started using gnucash.
>> 
>> Can this be ported back to 2.0.5 as well?
>> 
>> Thanks,
>> Jerry Quinn
>> 
>> 
>> Index: src/gnome/druid-loan.c
>> ===================================================================
>> --- src/gnome/druid-loan.c	(revision 15707)
>> +++ src/gnome/druid-loan.c	(working copy)
>> @@ -927,7 +927,7 @@
>>   {
>>           g_assert( ldd != NULL );
>>           g_assert( gstr != NULL );
>> -        g_string_append_printf( gstr, "pmt( %.5f / 12 : %0.2f : %0.2f : 0 : 0 )",
>> +        g_string_append_printf( gstr, "pmt( %.5f / 12.0 : %0.2f : %0.2f : 0 : 
>> 0 )",
>>                                   (ldd->ld.interestRate / 100),
>>                                   ( ldd->ld.numPer
>>                                     * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 
>> ) ) * 1.,
>> @@ -940,7 +940,7 @@
>>   {
>>           g_assert( ldd != NULL );
>>           g_assert( gstr != NULL );
>> -        g_string_printf( gstr, "ppmt( %.5f / 12 : i : %0.2f : %0.2f : 0 : 0 )",
>> +        g_string_printf( gstr, "ppmt( %.5f / 12.0 : i : %0.2f : %0.2f : 0 : 0 )",
>>                            (ldd->ld.interestRate / 100),
>>                            ( ldd->ld.numPer
>>                              * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) ) * 1.,
>> @@ -953,7 +953,7 @@
>>   {
>>           g_assert( ldd != NULL );
>>           g_assert( gstr != NULL );
>> -        g_string_printf( gstr, "ipmt( %.5f / 12 : i : %0.2f : %0.2f : 0 : 0 )",
>> +        g_string_printf( gstr, "ipmt( %.5f / 12.0 : i : %0.2f : %0.2f : 0 : 0 )",
>>                            (ldd->ld.interestRate / 100),
>>                            ( ldd->ld.numPer
>>                              * ( ldd->ld.perSize == GNC_MONTHS ? 1 : 12 ) ) * 1.,
>> _______________________________________________
>> gnucash-devel mailing list
>> gnucash-devel at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>> 
>
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at 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