Possible Duplicate:
Is there a string math evaluator in .NET?
Can C# parse mathematical expressions such as y=3*x + 3 into string? If so, ho? I appreciate your help.
Possible Duplicate:
Is there a string math evaluator in .NET?
Can C# parse mathematical expressions such as y=3*x + 3 into string? If so, ho? I appreciate your help.
I took a cheap way out in a recent Silverlight application by scrubbing the string with a regex (for safety) and passing it to the JavaScript evaluator. It actually works very well but it's a hack I admit.
http://josheinstein.com/blog/index.php/2010/03/mathevalconverter
Why don't you use Simple Math Parser or something is same? link text
Here's a bit of code I wrote a while ago to parse infix (operator operand operator) equations. There are some small classes and helper functions missing, but it should be fairly easy to implement them. If you need them or any help with it, let me know and I can upload them somewhere.
It's a basic implementation of Dijkstra's Shunting-yard algorithm
Possibly a duplicate of:
Is there a string math evaluator in .NET?
The short answer is no, for the long answer see the link. ( I recommend 'coppercoders' solution. )