Bug#343795: Treat all numbers in a auto-decimal-point-safe way.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14319 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled 2006-06-04 15:01:33 +00:00
parent 6a590e818a
commit 32cf6165e4
2 changed files with 12 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2006-06-04 Joshua Sled <jsled@asynchronous.org>
* src/gnome/druid-loan.c (ld_get_pmt_formula)
(ld_get_ppmt_formula, ld_get_ipmt_formula): Treat all numbers in a
auto-decimal-point-safe way. Bug#343795.
2006-06-04 Andreas Köhler <andi5.py@gmx.net>
* src/gnome-utils/gnc-html.[ch]:

View File

@ -934,10 +934,10 @@ ld_get_pmt_formula( LoanDruidData *ldd, GString *gstr )
{
g_assert( ldd != NULL );
g_assert( gstr != NULL );
g_string_append_printf( gstr, "pmt( %.5f / 12 : %d : %0.2f : 0 : 0 )",
g_string_append_printf( gstr, "pmt( %.5f / 12 : %0.2f : %0.2f : 0 : 0 )",
(ldd->ld.interestRate / 100),
( ldd->ld.numPer
* ( ldd->ld.perSize == MONTHS ? 1 : 12 ) ),
* ( ldd->ld.perSize == MONTHS ? 1 : 12 ) ) * 1.,
gnc_numeric_to_double(ldd->ld.principal) );
}
@ -947,10 +947,10 @@ ld_get_ppmt_formula( LoanDruidData *ldd, GString *gstr )
{
g_assert( ldd != NULL );
g_assert( gstr != NULL );
g_string_printf( gstr, "ppmt( %.5f / 12 : i : %d : %0.2f : 0 : 0 )",
g_string_printf( gstr, "ppmt( %.5f / 12 : i : %0.2f : %0.2f : 0 : 0 )",
(ldd->ld.interestRate / 100),
( ldd->ld.numPer
* ( ldd->ld.perSize == MONTHS ? 1 : 12 ) ),
* ( ldd->ld.perSize == MONTHS ? 1 : 12 ) ) * 1.,
gnc_numeric_to_double(ldd->ld.principal));
}
@ -960,10 +960,10 @@ ld_get_ipmt_formula( LoanDruidData *ldd, GString *gstr )
{
g_assert( ldd != NULL );
g_assert( gstr != NULL );
g_string_printf( gstr, "ipmt( %.5f / 12 : i : %d : %0.2f : 0 : 0 )",
g_string_printf( gstr, "ipmt( %.5f / 12 : i : %0.2f : %0.2f : 0 : 0 )",
(ldd->ld.interestRate / 100),
( ldd->ld.numPer
* ( ldd->ld.perSize == MONTHS ? 1 : 12 ) ),
* ( ldd->ld.perSize == MONTHS ? 1 : 12 ) ) * 1.,
gnc_numeric_to_double( ldd->ld.principal ) );
}