Bug 786708 - GnuCash won't load currency fractions larger than 1000000.

Also create larger fractions for the account dialog.
This commit is contained in:
John Ralls
2018-09-21 12:29:56 -07:00
parent 70bc472ffe
commit 80a4591736
9 changed files with 26 additions and 15 deletions

View File

@@ -687,7 +687,7 @@ gnc_account_class_init (AccountClass *klass)
"1 USD can be divided into 100 cents.",
0,
G_MAXINT32,
1000000,
GNC_COMMODITY_MAX_FRACTION,
static_cast<GParamFlags>(G_PARAM_READWRITE)));
g_object_class_install_property

View File

@@ -1111,7 +1111,7 @@ get_currency_denom(const Split * s)
}
else if (!s->parent || !s->parent->common_currency)
{
return 1000000; /* Max supported denom to avoid premature rounding. */
return GNC_COMMODITY_MAX_FRACTION;
}
else
{
@@ -1128,7 +1128,7 @@ get_commodity_denom(const Split * s)
}
else if (!s->acc)
{
return 1000000; /* Max supported denom to avoid premature rounding. */
return GNC_COMMODITY_MAX_FRACTION;
}
else
{

View File

@@ -842,7 +842,7 @@ gnc_commodity_class_init(struct _GncCommodityClass* klass)
"The fraction is the number of sub-units that "
"the basic commodity can be divided into.",
1,
1000000,
GNC_COMMODITY_MAX_FRACTION,
1,
G_PARAM_READWRITE));
g_object_class_install_property(gobject_class,

View File

@@ -115,6 +115,11 @@ GType gnc_commodity_namespace_get_type(void);
when presenting the currency related namespace to the user */
#define GNC_COMMODITY_NS_ISO_GUI N_("Currencies")
/** Max fraction is 10^9 because 10^10 would require changing it to an
* int64_t.
*/
#define GNC_COMMODITY_MAX_FRACTION 1000000000
typedef GList CommodityList;
/** @name Commodity Quote Source functions