If you would like to format any numbers or currencies within the document, you can use the number format modifier. See the example below:
{$amount|number_format:2:'.':','}
This will format the number with 2 decimal places, the decimal point as the decimal separator, and the comma, as the thousands separator.