This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

formatCurrency

Formats a number as currency using locale rules.

See more...

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

Parameters

value

Type: number.

locale

Type: string.

currency

Type: string.

currencyCode

Type: string.

Optional. Default is undefined.

digitsInfo

Type: string.

Optional. Default is undefined.

Returns

string

Description

Use currency to format a number as currency.

Where:

  • value is a number.
  • locale is a string 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 as USD for the US dollar and EUR for the euro.
  • digitInfo See DecimalPipe for more details.