I am trying to format a string in a template to display as a currency. {{ object.cost }}
Would I be able to do something like "${:,.2f}".format({{ object.cost }}) in the template?
>Solution :
You can try to use floatformat filter:
{{ object.cost|floatformat:2 }}
where 2 means two decimals.
As, Django templates: output float with all decimal places