Get storage and operations working together properly

This commit is contained in:
lolabird 2023-12-27 20:22:20 -07:00
commit 03dcf7a6d8

View file

@ -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;
} // // }
} }