JS: Convert Decimal, Hexadecimal
Decimal to Hexadecimal
console.log((15).toString(16).toUpperCase() === "F"); console.log((157).toString(16).toUpperCase() === "9D");
Hexadecimal to Decimal
// direct hexadecimal input // case doesn't matter console.log(0xff === 255); console.log(0xFF === 255); // convert hexadecimal to decimal console.log(parseInt("ff", 16) === 255); console.log(parseInt("FF", 16) === 255);
[see Number.parseInt]
JavaScript, Convert Decimal, Hexadecimal, Binary
JavaScript, String, Char, Encoding, Hexadecimal
JavaScript, Number
- JS: Number
- JS: Assignment Operators
- JS: Math Operators
- JS: Number Comparison Operators
- JS: Convert String, Number
- JS: Convert Decimal, Hexadecimal
- JS: Convert Decimal, Binary
- JS: Format Number
- JS: Random Integer Range Function ð
- JS: Number Object
- JS: Number Constructor
- JS: Number.prototype
- JS: Math