Convert Number to Hexadecimal

 

 

use to string method to convert number to hexadecimal 

 

const num = 42;


const hexnum  = num.toString(16);

// covert hexadecimal to number

const number = parseInt(hexnum, 16);
console.log(number); 

Tags:

Share:

Related posts