them with commas. I then found the following error:
>>import locale
'English_United States.1252'>>>locale.setlocale(locale.LC_ALL, 'English_United States.1252')
Traceback (most recent call last):>>locale.format('%d', float('2244012500.0000'), grouping = True)
File "<pyshell#28>", line 1, in <module>
locale.format('%d', float('2244012500.0000'), grouping = True)
File "C:\Python25\lib\locale.py", line 145, in format
formatted = percent % value
TypeError: int argument required
However, if the number is <= 2**31-1, it works just fine:
'224,401,250'>>>locale.format('%d', float('224401250.0000'), grouping = True)
Interestingly, if I first convert the floats to ints, , the function
works just fine, even if the numbers exceed 2**31-1:
'2,244,012,500'>>locale.format('%d', int(float('2244012500.0000')), grouping = True)
Is there an int/long related bug lurking in locale?
Sincerely
Thomas Philips