Skip to content

Commit

Permalink
feat(intg): clear all values after evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Dec 27, 2022
1 parent 445deb0 commit bf649f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/CalculatorContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ function appendDecimal() {
entry.value += "."
}
function appendToEntryScreen(valueToAppend: Entries) {
if (typeof valueToAppend === "number" && hasEvaluatedResult.value) clearAll()
if (valueToAppend === ".") appendDecimal()
else if (isEntryValueEmpty.value || mustResetOnNextEntry.value) entry.value = String(valueToAppend)
else entry.value += String(valueToAppend)
Expand Down

0 comments on commit bf649f0

Please sign in to comment.