Skip to content

parseInt

parseInt(string, radix?) → number · Math

Parse a string into an integer, optionally with a radix (base).

  • string (required): numeric string to parse

  • radix (optional): numeric base (default 10)

bash
echo '{"hex": "FF"}' | utlx -e 'parseInt($input.hex, 16)'
# 255
utlx
parseInt("42")                           // 42
parseInt("1010", 2)                      // 10

Released under AGPL-3.0.