Number Format

Frank Buss fb at
Wed Aug 28 20:00:02 CEST 2002

Michael.Winter at (Michael) wrote:

> But I can't get the format 2.000. Has anyone an idea ?

Looks like you are searching for the German locale setting. According to 
the documentation you can use "locale.setlocale(locale.LC_ALL, 'de')", but 
this fails on Windows XP and on RedHat Linux with an "locale setting not 
supported" error. But with the undocumented (at least I didn't found it in 
the documentation) 'GERMAN' it works:

import locale
locale.setlocale(locale.LC_ALL, 'GERMAN')
locale.format('%s', 9823443553.5, 1)

Frank Buß, fb at,

More information about the Python-list mailing list