formatCurrency
function
Formats a number as currency using locale rules.
formatCurrency(value: number, locale: string, currency: string, currencyCode?: string, digitsInfo?: string): string
Parameters
value | Type: |
locale | Type: |
currency | Type: |
currencyCode | Type: Optional. Default is |
digitsInfo | Type: Optional. Default is |
Returns
string
Description
Use currency
to format a number as currency.
Where:
-
value
is a number. -
locale
is astring
defining the locale to use. -
currency
is the string that represents the currency, it can be its symbol or its name. -
currencyCode
is the ISO 4217 currency code, such asUSD
for the US dollar andEUR
for the euro. -
digitInfo
SeeDecimalPipe
for more details.
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/common/formatCurrency