How do you convert decimal values to their hexadecimal equivalent in JavaScript?
function toHex(d) { return ("0"+(Number(d).toString(16))).slice(-2).toUpperCase() }