Make gnc_numeric values of zero always convertible to decimal form.

BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17456 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Charles Day 2008-08-07 18:18:00 +00:00
parent 96863860d0
commit eb29fc8e6d

View File

@ -1042,10 +1042,14 @@ gnc_numeric_to_decimal(gnc_numeric *a, guint8 *max_decimal_places)
return FALSE;
converted_val = *a;
fraction = converted_val.denom;
if (fraction <= 0)
if (converted_val.denom <= 0)
return FALSE;
/* Zero is easily converted. */
if (converted_val.num == 0)
converted_val.denom = 1;
fraction = converted_val.denom;
while (fraction != 1)
{
switch (fraction % 10)