[work] Fix division by zero
This commit is contained in:
parent
6ced297495
commit
95e4562b29
1 changed files with 2 additions and 2 deletions
4
bin/work
4
bin/work
|
@ -81,9 +81,9 @@ def work(args):
|
|||
total_delta += delta
|
||||
count += 1
|
||||
eight_h = timedelta(hours=8) * count
|
||||
mean_time = total_delta / count
|
||||
mean_time = total_delta / count if count > 0 else total_delta
|
||||
minutes = total_delta - eight_h
|
||||
month_mean_time = month_delta / month_count
|
||||
month_mean_time = month_delta / month_count if month_count > 0 else month_delta
|
||||
month_min = month_delta - timedelta(hours=(8 * month_count))
|
||||
print("stats: {}, {}".format(
|
||||
td_format(mean_time),
|
||||
|
|
Loading…
Reference in a new issue