Десятичный до гекса

function HEX(num) {return num.toString(16)}
//hex is also known as base 16 so you just say var.toBase16String
Dangerous Deer