insert thousands separators
P at draigBrady.com
P at draigBrady.com
Fri Jun 13 11:06:49 EDT 2003
More information about the Python-list mailing list
Fri Jun 13 11:06:49 EDT 2003
- Previous message (by thread): insert thousands separators
- Next message (by thread): insert thousands separators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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)
locale.setlocale(locale.LC_ALL,'')
print locale.format("%d",1000000,1)
Pádraig.
- Previous message (by thread): insert thousands separators
- Next message (by thread): insert thousands separators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list