Skip to content

Instantly share code, notes, and snippets.

@daphnesmit
Last active April 13, 2020 11:56
Show Gist options
  • Save daphnesmit/e88d2abd2f6c4c8a8722f79938fa5600 to your computer and use it in GitHub Desktop.
Save daphnesmit/e88d2abd2f6c4c8a8722f79938fa5600 to your computer and use it in GitHub Desktop.
LeasePlan challenge number to hex
function numberToHex(number) {
const step2 = Math.PI * number
const step3 = Math.round(step2 * 100) / 100
const step4 = ((number / 100) * 33) * step3
const step5 = Math.round(step4)
return step5.toString(16);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment