Skip to content

Commit

Permalink
797318 - Amounts ending in zero displayed as fractions
Browse files Browse the repository at this point in the history
  • Loading branch information
jean committed Apr 4, 2020
1 parent bedc963 commit 4a8350e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libgnucash/app-utils/gnc-ui-util.c
Expand Up @@ -1605,7 +1605,9 @@ PrintAmountInternal(char *buf, gnc_numeric val, const GNCPrintAmountInfo *info)
*buf = '\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 */
sprintf(temp_buf, "%" G_GINT64_FORMAT, whole.num);
num_whole_digits = strlen (temp_buf);
Expand Down
1 change: 1 addition & 0 deletions libgnucash/engine/gnc-numeric.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 4a8350e

Please sign in to comment.