Skip to content

Commit

Permalink
feat(intg): solve percentage in an expression
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Dec 27, 2022
1 parent a05d6cd commit 5df657e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/CalculatorContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const expressionToDisplay = computed(() => {
break
}
case "%": {
value = entry.value
if (!mayPassToRightEntry.value) value = entry.value
else value = `${leftEntry.value} ${operation.value} ${solvePercentage(rightEntry.value, leftEntry.value)}`
break
}
case "1/x": {
Expand Down Expand Up @@ -96,7 +97,6 @@ function setOperationValue(newOperation: Operations) {
operation.value = newOperation
}
function evaluateExpression(evaluationMethod: Evaluations) {
function evaluateBasicOperation() {
if (hasEvaluatedResult.value) leftEntry.value = Number(previousResult.value)
Expand Down

0 comments on commit 5df657e

Please sign in to comment.