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 result = 0
if (topScreen.textContent === "0") {
calc.calculate(mainScreen.textContent);
if (topScreen.textContent === "0" || !inOps) {
result = calc.calculate(mainScreen.textContent);
} else {
topScreen.textContent += mainScreen.textContent;
console.log("main: " + mainScreen.textContent);