Take a look at Babel package and Django helpers - http://babel.edgewall.org/
--
We read Knuth so you don't have to. - Tim Peters
Jarek Zgoda, R&D, Redefine
jarek...@redefine.pl
We can't use Python's locale module in Django. It doesn't allow
different locale settings in different threads.
Prior to 1.1 there will be some changes made there to add support for
number and date printing and validation (Karen's already pointed to one
of the relevant tickets). Currency display is probably out of scope,
since that's not actually particularly locale-dependent: it's specific
to the currency itself, not the output locale (display USD 1.25 as JPY
125,000 or something is just wrong).
Regards,
Malcolm
>>> 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).