Greetings!
JavaScript numbers are floating-point and therefore not implicitly convertible to
You can assign a
By the way, your first example works because ClearScript converts JavaScript numbers to managed integers when doing so results in no data loss, and integers are implicitly convertible to
Good luck!
JavaScript numbers are floating-point and therefore not implicitly convertible to
decimal
(see here for more information).You can assign a
decimal
property as follows:engine.AddHostObject("host", new HostFunctions()); engine.Execute("MyObject.Price = host.toDecimal(1.5)");
decimal
.Good luck!