I\'m trying to format a float as comma-separated currency. E.g. 543921.9354
becomes $543,921.94
. I\'m using the format
filter in Jinja t
def numberFormat(value):
return format(int(value), ',d')
@app.template_filter()
def numberFormat(value):
return format(int(value), ',d')
@app.app_template_filter()
def numberFormat(value):
return format(int(value), ',d')
{{ '1234567' | numberFormat }}
#prints 1,234,567
{{ format('1234567', ',d') }}
#prints 1,234,567