From 48666f8afdcc83959722706628e3bec8d74af196 Mon Sep 17 00:00:00 2001 From: Esko Kokkonen Date: Sun, 18 Dec 2011 14:09:15 +0200 Subject: [PATCH] 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 --- emerge-timer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) -- 2.44.0