mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 786708 - GnuCash won't load currency fractions larger than 1000000.
Also create larger fractions for the account dialog.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user