Код: Выделить всё
import locale
locale.setlocale( locale.LC_ALL, '' )
def format_currency(i):
return locale.currency(float(i), grouping=True)
Код: Выделить всё
Exception Type: TemplateSyntaxError
Exception Value: Caught ValueError while rendering: Currency formatting is not possible using the 'C' locale.
Exception Location: /usr/lib/python2.6/locale.py in currency, line 240
Код: Выделить всё
python manage.py shell
>>> import locale
>>> locale.setlocale( locale.LC_ALL, '' )
'en_CA.UTF-8'
>>> locale.currency(1, grouping=True)
'$1.00'
Подробнее здесь: https://stackoverflow.com/questions/295 ... hon-django