Docs Menu
API Developer Guide / middleware / pub / util / format / formatCurrency

Service: formatCurrency

This service is responsible for formatting a numerical value as a currency, including options for specifying the number of decimal places, the locale, and the currency symbol.

Input Parameter:

Name Type Description
number: Number The numerical value to be formatted as currency.
decimalPlaces: Integer The number of decimal places to include in the formatted currency value.
locale: String An optional parameter specifying the locale or region-specific formatting rules for currency. For example, "en_US" for US English formatting.
symbol: String An optional parameter specifying the currency symbol to be used. For example, "$" for US dollars.

Output Parameter:

Name Type Description
result: String The formatted currency value as a string.