Bug 797861 - Yearly / Monthly average reporting displays zeros

averaging-multiplier is an inexact value with Year or Month average.
gnc-numeric-convert seems to barf when it receives an inexact floating
point number.
This commit is contained in:
Christopher Lam 2020-07-19 17:43:27 +08:00
parent 82da49efc2
commit 11b75128cd

View File

@ -431,12 +431,9 @@ balance at a given time"))
;; everything foreign gets converted
;; (gnc:sum-collector-commodity) based on the average
;; cost of all holdings.
(gnc-numeric-convert
(* (gnc:gnc-monetary-amount
(gnc:sum-collector-commodity c report-currency exchange-fn))
averaging-multiplier)
(gnc-commodity-get-fraction report-currency)
GNC-RND-ROUND))
(* (gnc:gnc-monetary-amount
(gnc:sum-collector-commodity c report-currency exchange-fn))
averaging-multiplier))
;; Get balance of an account as an inexact number converted to,
;; and using precision of the report's currency.