{@a i18n-pipes}
Angular provides the following built-in data transformation pipes. The data transformation pipes use the LOCALE_ID
token to format data based on rules of each locale.
DatePipe
: Formats a date value.CurrencyPipe
: Transforms a number to a currency string.DecimalPipe
: Transforms a number into a decimal number string.PercentPipe
: Transforms a number to a percentage string.
For example, {{today | date}}
uses DatePipe
to display the current date in the format for the locale in LOCALE_ID
.
To override the value of LOCALE_ID
, add the locale
parameter.
For example, to force the currency to use en-US
no matter which language-locale you set for LOCALE_ID
, use this form: {{amount | currency : 'en-US'}}
.
@reviewed 2021-09-15