From: Esko Kokkonen Date: Sun, 18 Dec 2011 12:09:15 +0000 (+0200) Subject: Use float number when dealing with the time simplification X-Git-Url: http://git.itanic.dy.fi/?p=emerge-timer;a=commitdiff_plain;h=48666f8afdcc83959722706628e3bec8d74af196 Use float number when dealing with the time simplification This could bug out if you would give an int to the function, in which case it wouldn't return correct results --- diff --git a/emerge-timer.py b/emerge-timer.py index bfdb537..e1d1ec5 100755 --- a/emerge-timer.py +++ b/emerge-timer.py @@ -183,10 +183,10 @@ def give_time(time, nocolor=False): return(green_start + "unknown" + color_stop) - days = time/(3600*24) - hours = (days - int(days))*24 - minutes = (hours - int(hours))*60 - seconds = (minutes - int(minutes))*60 + days = time/(3600.0*24.0) + hours = (days - int(days))*24.0 + minutes = (hours - int(hours))*60.0 + seconds = (minutes - int(minutes))*60.0 days = int(days) hours = int(hours)