J
jake
Is there a way to evaluate a string expression such as "55/8" to
return 6.875?
Your help is greatly appreciated.
jake
return 6.875?
Your help is greatly appreciated.
jake
Is there a way to evaluate a string expression such as "55/8" to
return 6.875?
Your help is greatly appreciated.
jake
If you're on .NET 3.5, by far the easiest way is to use the Dynamic
LINQ sample. It would look something like this:
var expr = DynamicExpression.ParseLambda(null, typeof(decimal), "55 /
8");
var method = (Func<decimal>)expr.Compile();
Console.WriteLine(method()); // 6.875
You can find the download links to it here:
jake said:Is there a way to evaluate a string expression such as "55/8" to
return 6.875?
Is there a way to evaluate a string expression such as "55/8" to
return 6.875?
Your help is greatly appreciated.
jake