gnucash maint: Multiple changes pushed
Christopher Lam
clam at code.gnucash.org
Sun Jul 19 09:36:36 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/d546a617 (commit)
via https://github.com/Gnucash/gnucash/commit/11b75128 (commit)
from https://github.com/Gnucash/gnucash/commit/82da49ef (commit)
commit d546a617adb5c4dd9e8571ddbcf7cdb971dd7f71
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sun Jul 19 17:46:01 2020 +0800
ensure averaging-multipler returns exact numbers rather than floats
diff --git a/libgnucash/app-utils/date-utilities.scm b/libgnucash/app-utils/date-utilities.scm
index e600e5ddd..6d7faae88 100644
--- a/libgnucash/app-utils/date-utilities.scm
+++ b/libgnucash/app-utils/date-utilities.scm
@@ -110,8 +110,8 @@
(define (gnc:date-to-year-fraction caltime)
(let ((lt (gnc-localtime caltime)))
(+ (- (gnc:date-get-year lt) 1970)
- (/ (- (gnc:date-get-year-day lt) 1.0)
- (* 1.0 (gnc:days-in-year (gnc:date-get-year lt)))))))
+ (/ (- (gnc:date-get-year-day lt) 1)
+ (gnc:days-in-year (gnc:date-get-year lt))))))
;; return the number of years (in floating point format) between two dates.
(define (gnc:date-year-delta caltime1 caltime2)
@@ -146,9 +146,9 @@
;; convert a date in seconds since 1970 into # of months since 1970
(define (gnc:date-to-month-fraction caltime)
(let ((lt (gnc-localtime caltime)))
- (+ (* 12 (- (gnc:date-get-year lt) 1970.0))
+ (+ (* 12 (- (gnc:date-get-year lt) 1970))
(gnc:date-get-month lt) -1
- (/ (- (gnc:date-get-month-day lt) 1.0)
+ (/ (- (gnc:date-get-month-day lt) 1)
(gnc:days-in-month
(gnc:date-get-month lt)
(gnc:date-get-year lt))))))
commit 11b75128cd0c640854dc57f6d5ad4c3fd7b0b7c6
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sun Jul 19 17:43:27 2020 +0800
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.
diff --git a/gnucash/report/reports/standard/account-piecharts.scm b/gnucash/report/reports/standard/account-piecharts.scm
index 6bbec4cfb..c941ff413 100644
--- a/gnucash/report/reports/standard/account-piecharts.scm
+++ b/gnucash/report/reports/standard/account-piecharts.scm
@@ -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.
Summary of changes:
gnucash/report/reports/standard/account-piecharts.scm | 9 +++------
libgnucash/app-utils/date-utilities.scm | 8 ++++----
2 files changed, 7 insertions(+), 10 deletions(-)
More information about the gnucash-changes
mailing list