hex to decimal js code example
Example 1: javascript convert number to hex
yourNumber = parseInt(hexString, 16);
Example 2: to hex javascript
var rgbToHex = function (rgb) {
var hex = Number(rgb).toString(16);
if (hex.length < 2) {
hex = "0" + hex;
}
return hex;
};
Example 3: convert hexadecimal to decimal js
yourNumber = parseInt(hexString, 16);