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 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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue