797318 - Amounts ending in zero displayed as fractions

This commit is contained in:
jean 2020-04-04 13:04:37 -07:00
parent bedc9631f8
commit 4a8350ece2
2 changed files with 4 additions and 1 deletions

View File

@ -1606,6 +1606,8 @@ PrintAmountInternal(char *buf, gnc_numeric val, const GNCPrintAmountInfo *info)
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 */
sprintf(temp_buf, "%" G_GINT64_FORMAT, whole.num);
num_whole_digits = strlen (temp_buf);

View File

@ -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 :
*max_decimal_places;
if (a->num == 0) return TRUE;
try
{
GncNumeric an (*a);