Currency
The currency formatter displays currency values in a consistent format optimised for readability.
This formatter extends the Angular currency pipe. We use Angular pipes to provide consistent data formatting. Refer to the Angular pipes documentation.
When using custom Tangram pipes in a component.tstransform
Example
Behaviour
Decimal Places
All amounts are rounded to two decimal places by default using the '1.2-2' digit format.
Currency Code
The currencyCode
Symbol Display
The symbolDisplay
(default) - Shows the currency symbol (e.g., $1,234.56)'symbol' - Shows the currency code (e.g., NZD 1,234.56)'code' - Shows the narrow symbol variant'symbol-narrow'
Digits Format
The digitsminIntegerDigits.minFractionDigits-maxFractionDigits
Examples:
(default) - At least 1 integer digit, 2-2 decimal places'1.2-2' - No decimal places (whole numbers only)'1.0-0' - Up to 4 decimal places'1.0-4'
Trailing Zeros
The hideTrailingZeros