Get minus sign to act as both a sign change toggler and operator depending on on the context
This commit is contained in:
parent
97c9db13b9
commit
013623226d
1 changed files with 7 additions and 0 deletions
|
|
@ -43,6 +43,13 @@ function displayEval() {
|
|||
|
||||
function displayOperator() {
|
||||
let result = 0
|
||||
let operator = this.textContent;
|
||||
|
||||
if (operator == "-" && (isNaN(mainScreen.textContent) || mainScreen.textContent == "0")) {
|
||||
console.log("Entering changeSign");
|
||||
changeSign();
|
||||
return;
|
||||
}
|
||||
|
||||
if (topScreen.textContent == "" || !inOps) {
|
||||
topScreen.textContent = mainScreen.textContent + " " + this.textContent + " ";
|
||||
|
|
|
|||
Loading…
Reference in a new issue