Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js number to hex

number = 255
h = parseInt(number, 10).toString(16)
// Result: "ff"

// Add Padding
h = h.padStart(6, "0")
// Result: "0000ff"
 
PREVIOUS NEXT
Tagged: #js #number #hex
ADD COMMENT
Topic
Name
5+5 =