How to convert string formula to a mathematical formula in C#
10,546
Not sure why would you mention a compiler, but the simplest way will be to use a math expression evaluator, for example NCalc.
Related videos on Youtube
Author by
Justin
html-query-plan - Display SQL Server Execution Plans in HTML
Updated on June 04, 2022Comments
-
Justin over 1 year
If I have a string variable with a formula:
string myformula = "3 * 5 + Pow(2,3)";
How can I convert this string to a mathematical formula that the compiler can calculate?
-
Admin about 12 yearsFinally I got the FLEE library. The tool is free and perfectly fit for this purpose.
-
Clare Macrae about 12 yearsThe FLEE library is at flee.codeplex.com, and it does look very good. Why not write your own answer to this question (which is allowed/encouraged), so the question shows as answered, and others can up-vote your answer?
-