Ping: Re: [patch] FIx loan druid when auto_decimal is enabled
Jerry Quinn
jlquinn at optonline.net
Fri Mar 23 11:37:14 EDT 2007
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
>
More information about the gnucash-devel
mailing list