diff --git a/script.js b/script.js index 4c8aa9d..017bbec 100644 --- a/script.js +++ b/script.js @@ -17,6 +17,10 @@ class Calculator { appendNumber(number) { if (number === '.' && this.currentOperand.includes('.')) return + if (this.conclusion) { + this.currentOperand = "" + this.conclusion = 0 + } this.currentOperand = this.currentOperand.toString() + number.toString() } @@ -54,6 +58,7 @@ class Calculator { this.currentOperand = computation this.operation = undefined this.previousOperand = '' + this.conclusion = 1 } getDisplayNumber(number) { @@ -123,4 +128,4 @@ allClearButton.addEventListener('click', button => { deleteButton.addEventListener('click', button => { calculator.delete() calculator.updateDisplay() -}) \ No newline at end of file +})