insert thousands separators

P at P at
Fri Jun 13 17:06:49 CEST 2003

Marcus Bergmann wrote:
> Hi,
> how can I insert thousands separators into an integer or a string, e.g. 
> 1000000 to 1.000.000?

import locale

#this sets locale automatically (according to LC_ALL environment)

print locale.format("%d",1000000,1)


More information about the Python-list mailing list