refactor: Replace null with 0 in executeRPNCalculation function

This commit is contained in:
kwaroran
2024-06-04 00:52:34 +09:00
parent be6243beae
commit a4afc03d46

View File

@@ -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