mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix sigfigs(n) rounding to work when the input is bigger tnan 10**n.
For example rounding 1234567/1 to 6 significant figures would fail.
This commit is contained in:
@@ -171,7 +171,9 @@ GncRational::sigfigs_denom(unsigned figs) const noexcept
|
||||
++digits;
|
||||
val /= 10;
|
||||
}
|
||||
return not_frac ? powten(figs - digits - 1) : powten(figs + digits);
|
||||
return not_frac ?
|
||||
powten(digits < figs ? figs - digits - 1 : 0) :
|
||||
powten(figs + digits);
|
||||
}
|
||||
|
||||
GncRational
|
||||
|
||||
Reference in New Issue
Block a user