toCurrency
function, since version 1.2.1
categories: converting
toCurrency(amount, currencyId)
Converts numeric amount to currency. Please not that currencyId
parameter must match one of the currencies defined in your store.
parameters
- amount: number - currency amount
- currencyId: number - id of currency
return type
currency
examples
toCurrency(100, 1) => $100
toCurrency(200, 2) => €200