Check formula for errors #42
-
Hi, is it possible to check the formula for errors before evaluation? For ex:
|
Beta Was this translation helpful? Give feedback.
Answered by
AntonovAnton
Aug 30, 2024
Replies: 1 comment 3 replies
-
Hi! Please provide examples of expressions and what you are expecting to get. Currently the evaluator throws NotSupportedException with details what part of the expression it doesn't recognize. Also it throws FormatException if it doesn't recognize numbers. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! I’ve added error checking in version 1.1.8 for cases such as:
"12 + 3 * (120 + 5" (missing closing parenthesis)
"12 + sin()" (empty function call)
"12 + sin / 1" (incomplete function usage)
However, expressions like "12 + sin + 1" are still evaluated, as they can be interpreted as valid mathematical expressions, such as "12 + sin(+1)" by some evaluators. I’m avoiding strict restrictions to maintain flexibility in cases like "cos -1" and other similar scenarios.