ExpressionEvaluator icon indicating copy to clipboard operation
ExpressionEvaluator copied to clipboard

Ignore missing zero in numeric values

Open ko-vasilev opened this issue 3 years ago • 0 comments

Running the sample project mentioned in readme: https://dotnetfiddle.net/up4x3W I'm changing expression value to string expression = "1+.5"; which should be identical to string expression = "1+0.5"; (it is a valid syntax in C#)

Right now it throws an exception:

Invalid character [46:.]

Stack Trace:

[CodingSeb.ExpressionEvaluator.ExpressionEvaluatorSyntaxErrorException: Invalid character [46:.]]
   at CodingSeb.ExpressionEvaluator.ExpressionEvaluator.Evaluate(String expression)
   at Program.Main() :line 20

I wasn't able to find an option that could enable this behavior. Does it mean I need to tweak the evaluator like mentioned on this page? https://github.com/codingseb/ExpressionEvaluator/wiki/Advanced-Customization-and-Hacking

ko-vasilev avatar Jul 07 '22 00:07 ko-vasilev