getCurrencyStep()function

getCurrencyStep(currency: CurrencyCode, caller: AnyCaller = getCurrencyStep): number
ParamType
currencyCurrencyCode
The ISO 4217 currency code to get the step for. required
callerAnyCaller
The function to attribute a thrown error to (defaults to getCurrencyStep). Defaults to getCurrencyStep
Return
number
The smallest fractional unit used for the currency.
Throws
RequiredError
If the currency code is malformed or unsupported.

Get the "step" value for a currency, i.e. the smallest fractional unit that is used for that currency.

  • E.g. 0.01 for USD, 0.001 for some cryptocurrencies, and 1 for JPY.

Examples

getCurrencyStep("USD") // 0.01
getCurrencyStep("JPY") // 1