from django.contrib.humanize.templatetags.humanize import intcomma

def currency(dollars):
    dollars = round(float(dollars), 2)
return '$%s%s' % (intcomma(int(dollars)), ('%0.2f' % dollars)[-3:])
Format numbers in django templates