justicenation / slashclock

/clock concept as a new Slack app
GNU General Public License v3.0
0 stars 0 forks source link

Round numbers in report #36

Closed martyychang closed 6 years ago

martyychang commented 6 years ago

This pr resolves #29 by rounding numbers in reports with the assumption that open time entries should always have an end time that is rounded up to the next 6-minute or 0.1-hour increment. This increment is not configurable although the code that calculates the rounded value can support any increment in minutes.

What's important to note is that this only rounds open entries. So, for example, if a closed entry accounted for 7.25 hours, and the open entry currently shows a duration of 14 minutes, the total reported duration would show 7.55 hours. This value is the sum of the 7.25 hours from the closed entry plus the 14 minutes rounded up to 18 minutes or 0.3 hours.