cross platform use of set locale
timothy at open-networks.net
Wed Mar 23 11:52:06 CET 2005
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
>I think you're misusing locale. There is no guarantee that any specific
>locale will have properties (like grouping) set to a known value.
>Are you trying to format money? Then you need a special class so that
>you can say:
>d = Dollars(1000000.01)
>print "You have %s in your account" % d
>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 locale? it's exactly what locale is meant for
More information about the Python-list