Fixed a bug

This commit is contained in:
Armin Ronacher 2010-05-16 01:19:46 +02:00
parent 39eb088afc
commit 2ea7bffffb

View file

@ -125,9 +125,9 @@ def format_timedelta(delta, granularity='second', threshold=.85):
if value >= threshold or unit == granularity:
if unit == granularity and value > 0:
value = max(1, value)
value = str(int(round(value)))
value = unicode(int(round(value)))
value += u' ' + unit
if value != 1:
if value != u'1':
value += u's'
return value