Another small patch: this handles also partial times > 1d.
Marco
(defun org-clock-time% (total &rest strings)
"Compute a time fraction in percent.
TOTAL s a time string like 10:21 specifying the total times.
STRINGS is a list of strings that should be checked for a time.
The first string that does have a time will be used.
This function is made for clock tables."
(let ((day-re "\\([0-9]+\\)d \\([0-9]+\\):\\([0-9]+\\)")
(re "\\([0-9]+\\):\\([0-9]+\\)")
tot s)
(save-match-data
(catch 'exit
(if (not (string-match day-re total))
(if (not (string-match re total))
(throw 'exit 0.)
(setq tot (+ (string-to-number (match-string 2 total))
(* 60 (string-to-number (match-string 1 total))))))
(setq tot (+ (string-to-number (match-string 2 total))
(* 60 (string-to-number (match-string 1 total)))
(* 60 24 (string-to-number (match-string 1 total)))))
(if (= tot 0.) (throw 'exit 0.)))
(while (setq s (pop strings))
(if (string-match day-re s)
(throw 'exit
(/ (* 100.0 (+ (string-to-number (match-string 3 s))
(* 60 (string-to-number
(match-string 2 s)))
(* 60 24 (string-to-number
(match-string 1 s)))))
tot))
(if (string-match re s)
(throw 'exit
(/ (* 100.0 (+ (string-to-number (match-string 2 s))
(* 60 (string-to-number
(match-string 1 s)))))
tot)))))
0))))