Skip to content

getCurrencyDecimals

getCurrencyDecimals(currency) → number · Financial

Gets the number of decimal places for a currency code (ISO 4217).

  • currency (required): ISO 4217 currency code
bash
echo '{"cur": "JPY"}' | utlx -e 'getCurrencyDecimals($input.cur)'
# 0
utlx
{
  usdDecimals: getCurrencyDecimals("USD"),   // 2
  jpyDecimals: getCurrencyDecimals("JPY")    // 0
}

Released under AGPL-3.0.