Re: cross platform use of set locale

2005-03-24 Thread Facundo Batista
On Wed, 23 Mar 2005 20:52:06 +1000, Timothy Smith <[EMAIL PROTECTED]> wrote: > Serge Orlov wrote: > > >Are you trying to format money? Then you need a special class so that > >you can say: > > thats exactly what i'm trying to do, only having to do that for all my If you're dealing with money, tw

Re: cross platform use of set locale

2005-03-23 Thread Timothy Smith
Serge Orlov wrote: Timothy Smith wrote: Serge Orlov wrote: Timothy Smith wrote: thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper local

Re: cross platform use of set locale

2005-03-23 Thread Damjan
> SUS has added numeric grouping > >For some numeric conversions a radix character (`decimal >point') or thousands' grouping character is used. The >actual character used depends on the LC_NUMERIC part of >the locale. The POSIX locale uses `.' as radix ch

Re: cross platform use of set locale

2005-03-23 Thread Scott David Daniels
Timothy Smith wrote: Serge Orlov wrote: ... d = Dollars(100.01) print "You have %s in your account" % d and get You have $1,000,000.01 in your account. thats exactly what i'm trying to do, only having to do that for all my outputs is more work then i'd like :/ why is this a misuse of lo

Re: cross platform use of set locale

2005-03-23 Thread Serge Orlov
Timothy Smith wrote: > Serge Orlov wrote: > > >Timothy Smith wrote: > > > > > >>thats ok, but how do i get it to group thousands with a , ? > >>and thats would mean i'd have to run everything through a formatter > >>before i displayed it :/ it'd be nicer if i could just select a > >>proper locale >

Re: cross platform use of set locale

2005-03-23 Thread Timothy Smith
Serge Orlov wrote: Timothy Smith wrote: thats ok, but how do i get it to group thousands with a , ? and thats would mean i'd have to run everything through a formatter before i displayed it :/ it'd be nicer if i could just select a proper locale I think you're misusing locale. There is no g

Re: cross platform use of set locale

2005-03-23 Thread Serge Orlov
Timothy Smith wrote: > thats ok, but how do i get it to group thousands with a , ? > and thats would mean i'd have to run everything through a formatter > before i displayed it :/ it'd be nicer if i could just select a > proper locale I think you're misusing locale. There is no guarantee that any

Re: cross platform use of set locale

2005-03-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Timothy Smith wrote: >>> hi there i need to set my locale so that when i output a number it's >>> formatted with thousands grouped. [รข] >> >> import locale >> locale >> locale.setlocale(LC_ALL, '') >> locale.format('%.2f', 100, True) >> >>The `True` turns on grouping

Re: cross platform use of set locale

2005-03-22 Thread Timothy Smith
Marc 'BlackJack' Rintsch wrote: In <[EMAIL PROTECTED]>, Timothy Smith wrote: hi there i need to set my locale so that when i output a number it's formatted with thousands grouped. the problem i've found is there doesn't seem to be very good cross platform support for locales, even between uni

Re: cross platform use of set locale

2005-03-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Timothy Smith wrote: > hi there i need to set my locale so that when i output a number it's > formatted with thousands grouped. the problem i've found is there > doesn't seem to be very good cross platform support for locales, even > between unix's it's horrid. Have you