hours: round to nearest tenth for output
This commit is contained in:
parent
f902995097
commit
d507212a61
4
hours
4
hours
@ -82,13 +82,13 @@ def main(argv):
|
|||||||
sys.stdout.write(fmt_time_dt(time[1]))
|
sys.stdout.write(fmt_time_dt(time[1]))
|
||||||
seconds = (time[1] - time[0]).seconds
|
seconds = (time[1] - time[0]).seconds
|
||||||
hours = seconds / 60.0 / 60.0
|
hours = seconds / 60.0 / 60.0
|
||||||
sys.stdout.write(' (%.2f hours)' % hours)
|
sys.stdout.write(' (%.1f hours)' % round(hours, 1))
|
||||||
total_seconds += seconds
|
total_seconds += seconds
|
||||||
else:
|
else:
|
||||||
sys.stdout.write('???')
|
sys.stdout.write('???')
|
||||||
sys.stdout.write('\n')
|
sys.stdout.write('\n')
|
||||||
border()
|
border()
|
||||||
sys.stdout.write('Total: %.2f hours' % (seconds / 60.0 / 60.0))
|
sys.stdout.write('Total: %.1f hours' % round(seconds / 60.0 / 60.0, 1))
|
||||||
|
|
||||||
secs_in_total_hours = total_hours * 60 * 60
|
secs_in_total_hours = total_hours * 60 * 60
|
||||||
if total_seconds < secs_in_total_hours:
|
if total_seconds < secs_in_total_hours:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user