This commit is contained in:
Luke Rogers 2013-12-01 00:56:07 +13:00
parent 77459a0879
commit a59becca73
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ def plural(num=0, text=''):
return "{:,} {}{}".format(num, text, "s"[num==1:])
def format_time(seconds, accuracy=3, simple=False):
def format_time(seconds, count=3, simple=False):
if simple:
periods = [
('c', 60 * 60 * 24 * 365 * 100),
@ -44,7 +44,7 @@ def format_time(seconds, accuracy=3, simple=False):
strings = []
i = 0
for period_name, period_seconds in periods:
if i < accuracy:
if i < count:
if seconds > period_seconds:
period_value, seconds = divmod(seconds,period_seconds)
i += 1