mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
797318 - Amounts ending in zero displayed as fractions
This commit is contained in:
@@ -1605,7 +1605,9 @@ PrintAmountInternal(char *buf, gnc_numeric val, const GNCPrintAmountInfo *info)
|
|||||||
*buf = '\0';
|
*buf = '\0';
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Value may now be decimal, for example if the factional part is zero
|
||||||
|
value_is_decimal = gnc_numeric_to_decimal(&val, NULL);
|
||||||
/* print the integer part without separators */
|
/* print the integer part without separators */
|
||||||
sprintf(temp_buf, "%" G_GINT64_FORMAT, whole.num);
|
sprintf(temp_buf, "%" G_GINT64_FORMAT, whole.num);
|
||||||
num_whole_digits = strlen (temp_buf);
|
num_whole_digits = strlen (temp_buf);
|
||||||
|
|||||||
@@ -1073,6 +1073,7 @@ gnc_numeric_to_decimal(gnc_numeric *a, guint8 *max_decimal_places)
|
|||||||
{
|
{
|
||||||
int max_places = max_decimal_places == NULL ? max_leg_digits :
|
int max_places = max_decimal_places == NULL ? max_leg_digits :
|
||||||
*max_decimal_places;
|
*max_decimal_places;
|
||||||
|
if (a->num == 0) return TRUE;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GncNumeric an (*a);
|
GncNumeric an (*a);
|
||||||
|
|||||||
Reference in New Issue
Block a user