Skip to content

parseCurrency

parseCurrency(string) → number · Financial

Parse a currency-formatted string (with symbol and thousands separators) into a number.

  • string (required): currency string like "$1,234.56" or "EUR 1.000,00"
bash
echo '{"price": "$1,234.56"}' | utlx -e 'parseCurrency($input.price)'
# 1234.56
utlx
{
  amount: parseCurrency($input.total)
}

Released under AGPL-3.0.