Get storage and operations working together properly
This commit is contained in:
parent
f63ad42a36
commit
03dcf7a6d8
1 changed files with 5 additions and 6 deletions
11
script2.js
11
script2.js
|
|
@ -56,22 +56,21 @@ function displayOperator() {
|
||||||
topScreen.textContent = result + " " + this.textContent + " ";
|
topScreen.textContent = result + " " + this.textContent + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
mainScreen.textContent = result;
|
mainScreen.textContent = 0;
|
||||||
inOps = true;
|
inOps = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function displayNum() {
|
function displayNum() {
|
||||||
if (mainScreen.textContent == "0" || inOps) {
|
if (mainScreen.textContent == "0") {
|
||||||
mainScreen.textContent = this.textContent;
|
mainScreen.textContent = this.textContent;
|
||||||
inOps = false;
|
|
||||||
} else {
|
} else {
|
||||||
mainScreen.textContent += this.textContent;
|
mainScreen.textContent += this.textContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(topScreen.textContent) && isNaN(topScreen.textContent.charAt(-1))) {
|
// // if (isNaN(topScreen.textContent) && isNaN(topScreen.textContent.charAt(-1))) {
|
||||||
topScreen.textContent += this.textContent;
|
// // topScreen.textContent += this.textContent;
|
||||||
}
|
// // }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue