Comment

Neil Rashbrook

My apologies, I was working on two different computers and retyped the code snippet incorrectly. The correct code should of course be:

import locale
locale.setlocale(locale.LC_ALL, '')
def f5(n):
    return format(n, 'n')

Parent comment

Peter Bengtsson

Python 2.6.6 (r266:84292, Dec 5 2011, 09:38:23) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> format('n', 100000000) Traceback (most recent call last): File "", line 1, in TypeError: format expects arg 2 to be string or unicode, not int