Update DecimalToHex.js

updated as per `standard.js`
This commit is contained in:
Omkarnath Parida
2021-10-03 16:57:52 +05:30
committed by GitHub
parent c35b20a4ce
commit 38b42cf0a4

View File

@ -1,4 +1,4 @@
function intToHex(num) {
function intToHex (num) {
switch (num) {
case 10: return 'A'
case 11: return 'B'
@ -10,7 +10,7 @@ function intToHex(num) {
return num
}
function decimalToHex(num) {
function decimalToHex (num) {
const hexOut = []
while (num > 15) {
hexOut.unshift(intToHex(num % 16))