Converts a hex number value to a hex string with customizable prefix.
toHexString(16777215) // Returns '#ffffff'toHexString(0, '0x') // Returns '#000000' Copy
toHexString(16777215) // Returns '#ffffff'toHexString(0, '0x') // Returns '#000000'
Hex number value.
Output string prefix.
Converted hex string.
Converts a hex number value to a hex string with customizable prefix.
Example