Re: locale doesn' format
by gdamjan other posts by this author
Jul 20 2009 5:46PM messages near this date
Re: locale doesn' format
|
Problem with Thread.join()
> I want to format values to the german form eg. 1.034,56 but
> locale.format() doesn't work for me.
seems to work here
> >> import decimal, locale
> >> locale.setlocale(locale.LC_ALL, 'mk_MK.UTF-8')
'mk_MK.UTF-8'
> >> locale.localeconv()['grouping']
[3, 3, 0]
> >> locale.localeconv()['thousands_sep']
' '
> >> locale.localeconv()['decimal_point']
','
> >> locale.format('%f', 1034.56,True)
'1 034,560000'
> >> locale.format('%d', 1034.56,True)
'1 034'
ps.
you can copy/paste the above in .txt file and then run/test it with:
python -m doctest -v check.txt
--
дамÑан ( http://softver.org.mk/damjan/ )
Begin...the rest is easy.
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Jerry Hill
gdamjan
gdamjan
|