I have the JavaScript string for calculating some formulas, but I need to execute the scripts from C#.
Like JS formula string:
function(params) {
var itemAmount = 0,
itemsList = JSON.stringify(params.items),
billAmount = 0,
itemDiscountAmount = 0,
itemDiscountPercentage = 0,
maxDiscountAmount = 0,
maxDiscountPercentage = params.maxDiscountPercentage;
return {
billAmount: billAmount,
maxDiscountPercentage: maxDiscountPercentage,
maxDiscountAmount: maxDiscountAmount
};
});
I need to pass the param and get the result using C#.