mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
96863860d0
commit
eb29fc8e6d
@ -1042,10 +1042,14 @@ gnc_numeric_to_decimal(gnc_numeric *a, guint8 *max_decimal_places)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
converted_val = *a;
|
converted_val = *a;
|
||||||
fraction = converted_val.denom;
|
if (converted_val.denom <= 0)
|
||||||
if (fraction <= 0)
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* Zero is easily converted. */
|
||||||
|
if (converted_val.num == 0)
|
||||||
|
converted_val.denom = 1;
|
||||||
|
|
||||||
|
fraction = converted_val.denom;
|
||||||
while (fraction != 1)
|
while (fraction != 1)
|
||||||
{
|
{
|
||||||
switch (fraction % 10)
|
switch (fraction % 10)
|
||||||
|
Loading…
Reference in New Issue
Block a user