gnucash maint: Bug 779217 - Transactions rounded to 5 decimal places when opening file.

Geert Janssens geert.gnucash at kobaltwit.be
Sat Mar 11 06:26:08 EST 2017


On vrijdag 10 maart 2017 22:28:03 CET John Ralls wrote:
> 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.

How about defining this number in gnc_numeric and using this definition 
everywhere the max supported denom is used ?

Is this restriction the same in master ?

Geert


More information about the gnucash-devel mailing list