Skip to main content

hexToInt

Converts a hexadecimal string to an integer.

Parameters​

ParameterTypeOptionalDefaultDescription
hexstringfalseThe hexadecimal string to convert.

Returns​

number

Example​

hexToInt("ffffff"); // 16777215
hexToInt("#ffffff"); // 16777215