LitDev.LDMath.Evaluate C# (CSharp) Method

Evaluate() public static method

Evaluate a string expression to a number or boolean (if possible). The JScript command 'eval' is used and may therefore allow more complex JScript manipulations (also see LDInline). The TextWindow should be visible prior to using this method if later use of the TextWindow is required.
public static Evaluate ( Primitive expression ) : Primitive
expression Primitive The expression to evaluate, e.g. "(9/6) + 3" or "2.1 > 1.5".
return Primitive
        public static Primitive Evaluate(Primitive expression)
        {
            try
            {
                return Evaluator.EvalToString(expression);
            }
            catch (Exception ex)
            {
                Utilities.OnError(Utilities.GetCurrentMethod(), ex);
                return "";
            }
        }