number_format

Add thousands separators and optional decimal places.

Syntax

{{ value | number_format }}{{ value | number_format:2 }}

Example

01

Basic usage

InputTS
1{2  "amount": 1234567.893}
TemplateKNAP
1{{ amount | number_format:2 }}
OutputKNAP
11,234,567.89

Behavior

  • The optional parameter sets the number of decimal places.