mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix exception when converting to decimal values that reduce to N/1.
Before this the loop wouldn't terminate until the denominator had been reduced to 0 and trying to create a GncRational with a 0 denominator throws.
This commit is contained in:
@@ -368,7 +368,7 @@ GncNumeric::to_decimal(unsigned int max_places) const
|
||||
rr_num *= factor;
|
||||
rr_den *= factor;
|
||||
}
|
||||
while (!rr_num.isZero() && rr_num % 10 == 0)
|
||||
while (!rr_num.isZero() && rr_num > 9 && rr_den > 9 && rr_num % 10 == 0)
|
||||
{
|
||||
rr_num /= 10;
|
||||
rr_den /= 10;
|
||||
|
||||
Reference in New Issue
Block a user