How can I make the following work?
string formula = "({0} / {1}) + {2}";
string calc = string.format(formula,10,3,2);
double calculatedvalue = double.Parse(calc);
and have it return 5.3333333
How can I make the following work?
string formula = "({0} / {1}) + {2}";
string calc = string.format(formula,10,3,2);
double calculatedvalue = double.Parse(calc);
and have it return 5.3333333
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Andry LebedevPosted Oct 3, 2011, 2:23 AM
IExpression expression2 = BaseExpression.Parse("x/(95+y)");
var result = expression.Execute(...);
example
David JohnsonPosted Jun 30, 2008, 9:04 AM
Jan MontanoPosted Jun 27, 2008, 2:11 AM
This will get you started
Dynamic Formula Processing Library
*EDIT: here's a freeware. check it out.ELMathSolver .NET 2.31 freeware