From: Forrest Voight Date: Sun, 7 Jul 2013 07:26:27 +0000 (-0400) Subject: added year as an allowable time unit for display X-Git-Tag: 13.0~3 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=62a65ed608004510a8207ba16a2acacfd3aaef24;hp=658471106873abf52df0868fc6a6a5d4cafdcf05 added year as an allowable time unit for display --- diff --git a/p2pool/util/math.py b/p2pool/util/math.py index c45d1ec..04ed3ff 100644 --- a/p2pool/util/math.py +++ b/p2pool/util/math.py @@ -82,7 +82,7 @@ def format(x): return '%i' % (x,) + s def format_dt(dt): - for value, name in [(60*60*24, 'days'), (60*60, 'hours'), (60, 'minutes'), (1, 'seconds')]: + for value, name in [(365.2425*60*60*24, 'years'), (60*60*24, 'days'), (60*60, 'hours'), (60, 'minutes'), (1, 'seconds')]: if dt > value: break return '%.01f %s' % (dt/value, name)