I'm currently making a calculator using windows form and I'm using the string data type to store the math expression entered by the user. Except, when wanting to convert it to a data type which can give me the result I need to use an evaluator so I added the NCalc library to my project but it converts it to a double and I want it to give me a decimal as an output for precision reasons.
Is there any way to configure NCalc to perform computation in decimal
instead of double
? If not possible then what would be an efficient alternative?
string expression = "2+4+36/12"
double convertedExpression = Decimal.parse(expression);
It doesn't work this way but here is the idea of what I want. But it doesn't matter which way do I use to convert it I just want to convert a string wut==ith a mathematical expression to a decimal with the result of course.