From 1c865d95201a17fd1966c5feb15c023d8d2e71fd Mon Sep 17 00:00:00 2001 From: "Jarlem Red J. de Peralta" Date: Thu, 22 Dec 2022 16:05:11 +0800 Subject: [PATCH] refactor(intg): cast to string when evaluating --- src/components/CalculatorContainer.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CalculatorContainer.vue b/src/components/CalculatorContainer.vue index 5bfcb0f..e0f60db 100644 --- a/src/components/CalculatorContainer.vue +++ b/src/components/CalculatorContainer.vue @@ -37,10 +37,10 @@ function appendToEvaluationScreen(valueToAppend: PossibleButtonValues) { // Evaluated data and mutators const evaluatedValue = ref("0") function evaluateExpression(valueToAppend: PossibleButtonValues) { - evaluatedValue.value = evaluate(`${evaluationValue.value} ${entryValue.value}`) + evaluatedValue.value = String(evaluate(`${evaluationValue.value} ${entryValue.value}`)) appendToEvaluationScreen(valueToAppend) - entryValue.value = String(evaluatedValue.value) + entryValue.value = evaluatedValue.value }