From e3df32ce73e39bf94ff6d280cdfe367653b30fcd Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sat, 25 Jul 2020 22:29:17 +0800 Subject: [PATCH] [html-style-info] round amounts in price-render prices may be rendered as exact fractions. ensure they are rounded, with minimum of 4 decimal points. --- gnucash/report/html-style-info.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gnucash/report/html-style-info.scm b/gnucash/report/html-style-info.scm index 6ec971f042..a2f92d87b9 100644 --- a/gnucash/report/html-style-info.scm +++ b/gnucash/report/html-style-info.scm @@ -163,7 +163,11 @@ ;; renders a price to target currency (define (gnc:default-price-renderer currency amount) - (xaccPrintAmount amount (gnc-price-print-info currency #t))) + (xaccPrintAmount + (gnc-numeric-convert + amount (min 10000 (* 100 (gnc-commodity-get-fraction currency))) + GNC-HOW-RND-ROUND) + (gnc-price-print-info currency #t))) (define (gnc:default-html-gnc-monetary-renderer datum params) (let* ((comm (gnc:gnc-monetary-commodity datum))