[Tutor] Formatting Numbers as Strings 33000.50 -> 33,000.50

Sean 'Shaleh' Perry shaleh@valinux.com
Wed, 28 Mar 2001 09:52:35 -0800 (PST)


>> 
>> because debian currently ships with locales support enabled but the actual
>> locales are not being generated (to save space/time at the request of our
>> users).  cd /etc/ and edit locale.gen, then run locale-gen as root.
> 
> Not quite, but your response led me to the answer. It should be:
> 
> locale.setlocale(locale.LC_ALL,"en_US")
> 
> There are several english formats, several french formats, etc.
> 
> How platform (in)dependent is this "us" vs "en_US"?
> 

you want to use en_US or de_DE.  Or better yet, do not frob the value of locale
in the script at all.  The user should have his locale set if he wants things
to use it anyways.

And unless you enabled other locales, debian does ship with them disabled.  I
tried to set de_DE to test your code example and received the same message you
did.  Then I enabled de and all was well.