Ticket #4976: humanize_ordinal_TypeError_patch.diff
File humanize_ordinal_TypeError_patch.diff, 569 bytes (added by , 17 years ago) |
---|
-
contrib/humanize/templatetags/humanize.py
14 14 value = int(value) 15 15 except ValueError: 16 16 return value 17 except TypeError: 18 return value 17 19 t = (_('th'), _('st'), _('nd'), _('rd'), _('th'), _('th'), _('th'), _('th'), _('th'), _('th')) 18 20 if value % 100 in (11, 12, 13): # special case 19 21 return u"%d%s" % (value, t[0])