{ "id": "api/common/formatCurrency", "title": "formatCurrency", "contents": "\n\n
\n
\n
\n \n API > @angular/common\n
\n \n
\n \n
\n

formatCurrencylink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Formats a number as currency using locale rules.

\n\n \n
\n \n \n \n\n
\n \n\n formatCurrency(value: number, locale: string, currency: string, currencyCode?: string, digitsInfo?: string): string\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n value\n number\n

The number to format.

\n\n
\n \n locale\n string\n

A locale code for the locale format rules to use.

\n\n
\n \n currency\n string\n

A string containing the currency symbol or its name,\nsuch as \"$\" or \"Canadian Dollar\". Used in output string, but does not affect the operation\nof the function.

\n\n
\n \n currencyCode\n string\n

The ISO 4217\ncurrency code, such as USD for the US dollar and EUR for the euro.\nUsed to determine the number of digits in the decimal part.

\n

Optional. Default is undefined.

\n\n
\n \n digitsInfo\n string\n

Decimal representation options, specified by a string in the following format:\n{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}. See DecimalPipe for more details.

\n

Optional. Default is undefined.

\n\n
\n\n \n
Returns
\n

string: The formatted currency value.

\n \n \n\n\n \n\n \n
\n\n\n \n
\n

See alsolink

\n \n
\n\n\n \n\n\n\n \n\n\n
\n
\n\n\n" }