From c95b6039bae31401c6ae644869162c4001c59b5b Mon Sep 17 00:00:00 2001 From: Smig Tech Date: Thu, 12 Oct 2023 20:54:41 -0400 Subject: [PATCH] fix: add trim to appendNumber --- calculator/js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator/js/script.js b/calculator/js/script.js index fe6e4a1..b0b437d 100644 --- a/calculator/js/script.js +++ b/calculator/js/script.js @@ -29,7 +29,7 @@ const ops = { display.textContent = "0"; }, appendNumber: function(num) { - if(num === "0" && display.textContent === "0") return + if(num === "0" && display.textContent.trim() === "0") return if(!ops.numFlag && ops.checkLength(ops.firstNum)) { ops.firstNum += num; updateDisplay(ops.firstNum);