Money formatting

John Lenton jlenton at gmail.com
Mon Jul 5 07:16:51 EDT 2004


On Sun, 4 Jul 2004 12:21:38 +0300, Tonguc Yumruk
<tongucyumruk at member.fsf.org> wrote:
> I'm trying to format an integer as money. As far as i can see there is
> no strfmon() in python. I also tried the
> locale.format("%.2f",100000000,True) way but it does not even made the
> grouping work. I tried to hack some locale-related files (especially
> /usr/share/i18n/locales/tr_TR), but it dosn't worked either. Of course I
> can use brute force and make grouping and money formatting to work by
> hand but I think it's not a very pythonic way. Are there any library
> functions which I'm missing? Or will I have to use brute force?

for some reason I have yet to fathom, python clears LC_NUMERIC. Also,
you might care to read
http://mail.python.org/pipermail/python-list/2004-January/202333.html

-- 
John Lenton (jlenton at gmail.com) -- Random fortune:
bash: fortune: command not found




More information about the Python-list mailing list