gnucash maint: Bug 779217 - Transactions rounded to 5 decimal places when opening file.
John Ralls
jralls at code.gnucash.org
Fri Mar 10 16:28:03 EST 2017
Updated via https://github.com/Gnucash/gnucash/commit/3889606d (commit)
from https://github.com/Gnucash/gnucash/commit/bc50f3da (commit)
commit 3889606dd6779564341247ec796a905b54d36426
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Mar 10 13:21:02 2017 -0800
Bug 779217 - Transactions rounded to 5 decimal places when opening file.
xaccSplitSetValue and xaccSplitSetAmount round to the denominator found by
get_currency_denom and get_commodity_denom. The problem was that if the
commodity was unfindable because either the splitâs parent or account hadnât
been set (as is the case during loading, because the parent isnât yet complete)
the returned denominator would be 100000, smaller than the max supported.
That would cause the value/amount to be prematurely rounded.
diff --git a/src/engine/Split.c b/src/engine/Split.c
index 8d34c23..6ed3a4e 100644
--- a/src/engine/Split.c
+++ b/src/engine/Split.c
@@ -928,7 +928,7 @@ get_currency_denom(const Split * s)
}
else if (!s->parent || !s->parent->common_currency)
{
- return 100000;
+ return 1000000; /* Max supported denom to avoid premature rounding. */
}
else
{
@@ -945,7 +945,7 @@ get_commodity_denom(const Split * s)
}
else if (!s->acc)
{
- return 100000;
+ return 1000000; /* Max supported denom to avoid premature rounding. */
}
else
{
Summary of changes:
src/engine/Split.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
More information about the gnucash-changes
mailing list