Converting from double to decimal (e.g. 100.00m)

Jan 31, 2011 at 8:48 PM

I am using self written functions that return decimals.

I need to multiply the results of these functions by a number with a decimal point.

 

void Test()
{
   decimal a = 20;
   Expression ex = new Expression("a * 100.00", EvaluateOptions.IgnoreCase | EvaluateOptions.NoCache);
   ex.EvaluateParameter += delegate(string name, ParameterArgs arg)
   {
      if (name == "a")
        arg.Result = a;
   };
   MessageBox.Show(ex.Evaluate().ToString());
}

 

But I get the error message "Operator '*' cannot be applied to operands of type 'double' and 'decimal'"

In C# I would write "a * 100.00m" - how could I do this with NCalc?