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

Rick Pasotto rick@niof.net
Wed, 28 Mar 2001 12:44:14 -0500


On Wed, Mar 28, 2001 at 09:38:03AM -0800, Sean 'Shaleh' Perry wrote:
> > 
> > When I do that [actually, locale.setlocale(locale.LC_ALL,"us")] I get
> > 'locale setting not supported.' What do I need to do to get it
> > supported? I'm running debian and the 'locales' package is installed.
> > 
> 
> 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"?

-- 
"If ye love wealth better than liberty, the tranquility of servitude
better than the animating contest of freedom, go home from us in
peace.  We seek not your counsels or arms.  Crouch down and lick the
hands which feed you.  May your chains set lightly upon you, and may
posterity forget that ye were our countrymen."
		-- Samuel Adams
		   Rick Pasotto email: rickp@telocity.com