Other answers are 100% correct, but not very practical, since you still have to manually control output, formatting, etc.
I would suggest using django-money :
from djmoney.models.fields import MoneyField from django.db import models def SomeModel(models.Model): some_currency = MoneyField( decimal_places=2, default=0, default_currency='USD', max_digits=11, )
Works automatically from templates:
{{ somemodel.some_currency }}
Exit:
$123.00
It has a powerful backend via python-money and replaces standard decimal fields.
Michael Thompson May 27 '16 at 12:29 a.m. 2016-05-27 00:29
source share