From af8e3d13d46b6eede56bed2d6726f7a66c6a44d3 Mon Sep 17 00:00:00 2001 From: fecqs <466712071@qq.com> Date: Fri, 26 Jun 2020 20:28:09 +0800 Subject: [PATCH] I found a mistake Push should be converted to hexout. unshift --- Conversions/DecimalToHex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Conversions/DecimalToHex.js b/Conversions/DecimalToHex.js index 0fa1b4c12c..5b130de9a6 100644 --- a/Conversions/DecimalToHex.js +++ b/Conversions/DecimalToHex.js @@ -13,7 +13,7 @@ function intToHex (num) { function decimalToHex (num) { const hexOut = [] while (num > 15) { - hexOut.push(intToHex(num % 16)) + hexOut.unshift(intToHex(num % 16)) num = Math.floor(num / 16) } return intToHex(num) + hexOut.join('')