diff --git a/libgnucash/scm/price-quotes.scm b/libgnucash/scm/price-quotes.scm index 732704f3df..d0f938ef45 100644 --- a/libgnucash/scm/price-quotes.scm +++ b/libgnucash/scm/price-quotes.scm @@ -404,12 +404,13 @@ (else #f))) (if price + ;; The second argument to inexact->exact is chosen to give reasonable values + ;; for prices between .12345e-9 and 12345678.87654 + + ;; inexact->exact is probably not necessary but it can't hurt and is cheap. (set! price - (double-to-gnc-numeric price - GNC-DENOM-AUTO - (logior GNC-DENOM-REDUCE - GNC-RND-NEVER)))) - + (gnc-scm-to-numeric + (rationalize (inexact->exact price) 1/1000000000000000)))) (if gnc-time (set! gnc-time (timestr->time64 gnc-time time-zone)) (set! gnc-time (gnc:get-today)))