A useful, but painful, one-liner to edit money amounts

Steven D'Aprano steve-REMOVE-THIS at cybersource.com.au
Thu Aug 5 10:29:54 CEST 2010


On Thu, 05 Aug 2010 00:22:57 -0700, geremy condra wrote:

>>>>> locale.setlocale(locale.LC_ALL, "")
>> 'de_DE.UTF-8'
>>>>> print locale.currency(13535, grouping=True)
>> 13.535,00 €
>>>>> print locale.format("%d", 13535, grouping=True)
>> 13.535
>>
>> Peter
> 
> I had literally no idea this existed. Thanks.

I knew it existed, but completely forgot about it.

Thanks also Peter.


-- 
Steven



More information about the Python-list mailing list