fix: add trim to appendNumber

This commit is contained in:
Mike 2023-10-12 20:54:41 -04:00
parent a3fe4d397a
commit c95b6039ba

View file

@ -29,7 +29,7 @@ const ops = {
display.textContent = "0"; display.textContent = "0";
}, },
appendNumber: function(num) { 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)) { if(!ops.numFlag && ops.checkLength(ops.firstNum)) {
ops.firstNum += num; ops.firstNum += num;
updateDisplay(ops.firstNum); updateDisplay(ops.firstNum);