mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[eguile-utilities.scm] fmtnumeric: use xaccPrintAmount
fmtnumeric is used to render Quantity, Discount percent. Previously it would render 1/3 as 0.333333333. Use xaccPrintAmount to show exact fractions for Qty and Discount, where appropriate.
This commit is contained in:
parent
2acba0ea18
commit
5acf686c76
@ -34,12 +34,13 @@
|
||||
(use-modules (gnucash report))
|
||||
|
||||
(define-public (fmtnumber n)
|
||||
(issue-deprecation-warning "fmtnumber is deprecated")
|
||||
;; Format a number (integer or real) into something printable
|
||||
(number->string (if (integer? n) (inexact->exact n) n)))
|
||||
|
||||
;; Format gnc-numeric n with as many decimal places as required
|
||||
;; Format gnc-numeric n with decimal places, or exact fraction
|
||||
(define-public fmtnumeric
|
||||
(compose fmtnumber exact->inexact))
|
||||
(lambda (n) (xaccPrintAmount n (gnc-default-print-info #f))))
|
||||
|
||||
(define-public (gnc-monetary-neg? monetary)
|
||||
;; return true if the monetary value is negative
|
||||
|
Loading…
Reference in New Issue
Block a user