Fix how equals handles numbers that have no operator

This commit is contained in:
lolabird 2023-12-27 21:16:55 -07:00
commit a4621cda00

View file

@ -28,8 +28,8 @@ function displayEval() {
let calc = new Calculator; let calc = new Calculator;
let result = 0 let result = 0
if (topScreen.textContent === "0") { if (topScreen.textContent === "0" || !inOps) {
calc.calculate(mainScreen.textContent); result = calc.calculate(mainScreen.textContent);
} else { } else {
topScreen.textContent += mainScreen.textContent; topScreen.textContent += mainScreen.textContent;
console.log("main: " + mainScreen.textContent); console.log("main: " + mainScreen.textContent);