Browse Source

org-table.el (org-table-sum): Fix rounding error when summing times

* org-table.el (org-table-sum): Fix rounding error when
summing times.

Thanks to Paul Stansell for reporting this and to Nick Dokos for
providing the fix.

See http://mid.gmane.org/87ppv2atvf.fsf%40gmail.com for the
discussion of this bug.
Bastien Guerry 11 years ago
parent
commit
244aaa3d72
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/org-table.el

+ 1 - 1
lisp/org-table.el

@@ -2099,7 +2099,7 @@ If NLAST is a number, only the NLAST fields will actually be summed."
 			   h (floor (/ diff 3600)) diff (mod diff 3600)
 			   m (floor (/ diff 60)) diff (mod diff 60)
 			   s diff)
-		     (format "%d:%02d:%02d" h m s))))
+		     (format "%.0f:%02.0f:%02.0f" h m s))))
 	(kill-new sres)
 	(if (org-called-interactively-p 'interactive)
 	    (message "%s"