Javascript Number Type Convert Decimal to Hexadecimal Value

Introduction

Use the Number toString() method:

let num = 255; /* w w  w.ja va  2  s  .  c  o m*/

     // displays ff, which is hexadecimal equivalent for 255 
console.log(num.toString(16)); 



PreviousNext

Related