Fix how equals handles numbers that have no operator
This commit is contained in:
parent
b99261cee3
commit
a4621cda00
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue