Last active
April 13, 2020 11:56
-
-
Save daphnesmit/e88d2abd2f6c4c8a8722f79938fa5600 to your computer and use it in GitHub Desktop.
LeasePlan challenge number to hex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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