Wiadomość napisana w dniu 2008-09-23, o godz. 17:51, przez pihentagy:

>>> How can I print a number using the locale's thousand separator and
>>> decimal?
>>
>>> Basically I hoped ther is a template filter, but floatformat doesn't
>>> have thousand separator, and seems to use decimal point always.
>>
>> Take a look at Babel package and Django helpers -http://babel.edgewall.org/
>
> Ok, but there is also the module locale.
> Should I really use other libraries for just displaying a number in a
> page? Django supports translations, doesn't it supports printing
> numbers and currency honoring the currently selected language?

Additionally to what's been said by others, Python's own locale module  
isn't that good in formatting dates and numbers. Babel uses CLDR  
database to provide most accurate l10n data for many locations and  
languages, event those not supported by standard NLS machinery. Plus  
on linux it does not require installing appropriate language support -  
you can do eg. Hungarian date, number and currency formatting without  
installing Hungarian language support package (language-pack-hu on  
Ubuntu).

-- 
We read Knuth so you don't have to. - Tim Peters

Jarek Zgoda, R&D, Redefine
[EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to