[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.
This commit is contained in:
Christopher Lam 2020-07-25 22:29:17 +08:00
parent c1bd4c0e25
commit e3df32ce73

View File

@ -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))