diff --git a/cmds/gentest.py b/cmds/gentest.py index 19f8e48..8ba579e 100644 --- a/cmds/gentest.py +++ b/cmds/gentest.py @@ -60,13 +60,10 @@ def run(self): def ordinalth(n): last = n - n / 10 * 10 - if last == 1: - return '%dst' % n - elif last == 2: - return '%dnd' % n - elif last == 3: - return '%drd' % n - return '%dth' % n + ordinals = ['st', 'nd', 'rd', 'th'] + if last > 3: + last = 4 + return '%d%s' % (n, ordinals[last-1]) def generate_testsuite(url, name, locale):