Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Decimal values problems

$
0
0
Hi Igor,

Can you give me example?

Sure. One thing you could do is use a host method to operate on decimal values:
scripter.Script.add = new Func<decimal, decimal, decimal>((a, b) => a + b);
Console.WriteLine(scripter.Evaluate("add(num1, num2)")); 
Another possibility might be to use a host method to cast decimal values to a type that VBScript can deal with:
scripter.Script.toDouble = new Func<decimal, double>(value => (double)value);
Console.WriteLine(scripter.Evaluate("toDouble(num1) + toDouble(num2)"));
Good luck!

Viewing all articles
Browse latest Browse all 2297

Latest Images

Trending Articles





Latest Images