Avoid rounding errors whe summing table columns.

This commit is contained in:
Carsten Dominik 2008-09-24 17:33:10 +02:00
parent 990a549370
commit 7b54d28c30
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2008-09-24 Carsten Dominik <dominik@science.uva.nl>
* org-table.el (org-table-sum): Do not format the result with %g,
it does rounding when there are too many digits.
* org.el (org-map-entries): Protect the keyword-selecting variables.
2008-09-23 Bastien Guerry <bzg@altern.org>

View File

@ -1644,7 +1644,7 @@ If NLAST is a number, only the NLAST fields will actually be summed."
items1)))
(res (apply '+ numbers))
(sres (if (= org-timecnt 0)
(format "%g" res)
(number-to-string res)
(setq diff (* 3600 res)
h (floor (/ diff 3600)) diff (mod diff 3600)
m (floor (/ diff 60)) diff (mod diff 60)