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

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>