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

Peter Otten __peter__ at web.de
Thu Aug 5 17:13:10 EDT 2010


Steven D'Aprano wrote:

> 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.

You're welcome!



More information about the Python-list mailing list