expression-evaluator-c-sharp icon indicating copy to clipboard operation
expression-evaluator-c-sharp copied to clipboard

Set the Culture for expression evaluation

Open butulia opened this issue 2 years ago • 2 comments

Hi @matheval

First of all thank you very much for your work, I am very satisfied with the library. Very good work.

Evaluating formulas with numeric literals can give errors depending on the thread's CurrentCulture. It would be very helpful if, when instantiating an Expression, you could indicate the culture you want to work with, for example, through a chained method, just like you have SetScale().

Proposal example: new Expression("18293.3402*403.282").SetCulture(CultureInfo.InvariantCulture).Eval<decimal>();

Thank you very much in advance, regards

butulia avatar Sep 02 '22 10:09 butulia

@butulia Thank for your feedback. I promised another guy that I would fix #2 issue by this year July but I haven't done yet. I will try to combine #2 and #3(your issue) on this year and release new nuget version.

matheval avatar Sep 03 '22 01:09 matheval

Thank you very much. New version of Nuget will be upload soon

matheval avatar Sep 08 '22 05:09 matheval