summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToby S. Cubitt <tsc25@cantab.net>2012-11-20 17:15:21 (GMT)
committer Nicolas Goaziou <n.goaziou@gmail.com>2012-11-20 19:22:59 (GMT)
commit6d01be052d9ec01164b9dd70e0b21d5da5a41c5f (patch)
tree3e846dd18ffeff1dc239dc28f520d44c541febb1
parentc3407d3c985347bbf6710066ccee5241f4114dc0 (diff)
downloadorg-mode-6d01be052d9ec01164b9dd70e0b21d5da5a41c5f.zip
org-mode-6d01be052d9ec01164b9dd70e0b21d5da5a41c5f.tar.gz
Fix org-minutes-to-clocksum-string to cope with floating point arguments.
-rw-r--r--lisp/org.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/org.el b/lisp/org.el
index dc411b8..e3354c6 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16773,19 +16773,19 @@ The format is determined by `org-time-clocksum-format',
(format org-time-clocksum-fractional-format (/ m 60.0)))
;; choice of fractional formats for different time units
((and (setq fmt (plist-get org-time-clocksum-fractional-format :years))
- (> (/ m (* 365 24 60)) 0))
+ (> (/ (truncate m) (* 365 24 60)) 0))
(format fmt (/ m (* 365 24 60.0))))
((and (setq fmt (plist-get org-time-clocksum-fractional-format :months))
- (> (/ m (* 30 24 60)) 0))
+ (> (/ (truncate m) (* 30 24 60)) 0))
(format fmt (/ m (* 30 24 60.0))))
((and (setq fmt (plist-get org-time-clocksum-fractional-format :weeks))
- (> (/ m (* 7 24 60)) 0))
+ (> (/ (truncate m) (* 7 24 60)) 0))
(format fmt (/ m (* 7 24 60.0))))
((and (setq fmt (plist-get org-time-clocksum-fractional-format :days))
- (> (/ m (* 24 60)) 0))
+ (> (/ (truncate m) (* 24 60)) 0))
(format fmt (/ m (* 24 60.0))))
((and (setq fmt (plist-get org-time-clocksum-fractional-format :hours))
- (> (/ m 60) 0))
+ (> (/ (truncate m) 60) 0))
(format fmt (/ m 60.0)))
((setq fmt (plist-get org-time-clocksum-fractional-format :minutes))
(format fmt m))
@@ -16805,27 +16805,27 @@ The format is determined by `org-time-clocksum-format',
(format org-time-clocksum-format (setq n (/ m 60)) (- m (* 60 n)))
;; separate formats components
(and (setq fmt (plist-get org-time-clocksum-format :years))
- (or (> (setq n (/ m (* 365 24 60))) 0)
+ (or (> (setq n (/ (truncate m) (* 365 24 60))) 0)
(plist-get org-time-clocksum-format :require-years))
(setq clocksum (concat clocksum (format fmt n))
m (- m (* n 365 24 60))))
(and (setq fmt (plist-get org-time-clocksum-format :months))
- (or (> (setq n (/ m (* 30 24 60))) 0)
+ (or (> (setq n (/ (truncate m) (* 30 24 60))) 0)
(plist-get org-time-clocksum-format :require-months))
(setq clocksum (concat clocksum (format fmt n))
m (- m (* n 30 24 60))))
(and (setq fmt (plist-get org-time-clocksum-format :weeks))
- (or (> (setq n (/ m (* 7 24 60))) 0)
+ (or (> (setq n (/ (truncate m) (* 7 24 60))) 0)
(plist-get org-time-clocksum-format :require-weeks))
(setq clocksum (concat clocksum (format fmt n))
m (- m (* n 7 24 60))))
(and (setq fmt (plist-get org-time-clocksum-format :days))
- (or (> (setq n (/ m (* 24 60))) 0)
+ (or (> (setq n (/ (truncate m) (* 24 60))) 0)
(plist-get org-time-clocksum-format :require-days))
(setq clocksum (concat clocksum (format fmt n))
m (- m (* n 24 60))))
(and (setq fmt (plist-get org-time-clocksum-format :hours))
- (or (> (setq n (/ m 60)) 0)
+ (or (> (setq n (/ (truncate m) 60)) 0)
(plist-get org-time-clocksum-format :require-hours))
(setq clocksum (concat clocksum (format fmt n))
m (- m (* n 60))))