#+TBLFM: $3='(org-clock-time% @2$2 $2);%.1f;::$4='(org-clock-time% "40:00" $2);%.1f;My table would end up getting columns that showed
- The percentage (time for this row / total time),
- The percentage (time for this row / 40 hours)
To debug this I used the variable
org-table-formula-debug
which
outputs information when Org formulas are evaluated. Please see the
function org-table-eval-formula
in the file org-table.el
.
(setq org-table-formula-debug t)It showed me something like:
Substitution history of formula Orig: '(org-clock-time% "40:00" $2);%.1f; $xyz-> '(org-clock-time% "40:00" $2) @r$c-> '(org-clock-time% "40:00" $2) $1-> '(org-clock-time% "40:00" "1480") Result: 0 Format: %.1f Final: 0.0Indeed, evaluating
(org-clock-time% "40:00" "1480")
gives me 0.
So I set
edebug-on-entry
for this function, and tried evaluating
the above statement (using M-:
).
I ended up adding the following condition to fix my problem:
((string-match "\\([0-9]+\\)" s) (throw 'exit (/ (* 100.0 (string-to-number (match-string 1 s))) tot)))
0 comments:
Post a Comment