From a4afc03d4680604d1566be235c07cb26b12138d2 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Tue, 4 Jun 2024 00:52:34 +0900 Subject: [PATCH] refactor: Replace null with 0 in executeRPNCalculation function --- src/ts/process/infunctions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/process/infunctions.ts b/src/ts/process/infunctions.ts index db569291..40dd0076 100644 --- a/src/ts/process/infunctions.ts +++ b/src/ts/process/infunctions.ts @@ -114,7 +114,7 @@ function executeRPNCalculation(text:string) { return "0" } return parsed.toString() - }).replace(/&&/g, '&').replace(/\|\|/g, '|').replace(/<=/g, '≤').replace(/>=/g, '≥').replace(/==/g, '=') + }).replace(/&&/g, '&').replace(/\|\|/g, '|').replace(/<=/g, '≤').replace(/>=/g, '≥').replace(/==/g, '=').replace(/null/gi, '0') const expression = toRPN(text); const evaluated = calculateRPN(expression); return evaluated