ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved