I use org-mode to do time registration. Is there a way to round time register using clock-in / clock-out up to a multiple of a user defined value for instance 5 mins when generating a org-clock-table report?
I had to do something similar at work and I solved it by calling the clocktable with a (calc) formula:
#+BEGIN: clocktable :maxlevel 3 :block 2017-10-24 :formula "$2=$3;t::$3=if($2 == 0, string(\"\"), round(100*ceil($2*12)/12)/100)" #+END:
- Depending on your use of levels (
maxlevels) you might need to change the column numbers.
- I usually create a clocktable per day.
:block 2017-10-24would be for today.
- Since the clocktable usually contains the clocked time in the format
0:00which is not as easy to calculate with, I use the
tflag to display the values in decimal numbers. This requires
org-table-duration-custom-formatto be set to the default
- Then I use some calc formulas:
ceilis used to round up to the next full 5 minutes. If you prefer to go to the nearest 5 minute unit (round up or down), you can replace it with
round. The outer formula (
round) is then used that the result has only two decimals digits.
- I use the
ifclause to check if the result is 0.00 or not. If it is, which means there is no clocked time (in my case on the headers), the cell should be empty.