Open mkalinski93 opened 2 years ago
There is no ready-made function for it, but you can achieve this by implementing a https://github.com/ncalc/ncalc/blob/master/src/NCalc/Domain/LogicalExpressionVisitor.cs that does it. You could take most of https://github.com/ncalc/ncalc/blob/master/src/NCalc/Domain/SerializationVisitor.cs but modify Visit(Identifier)
to evaluate the parameter and add that to the string instead. The parameter evaluation can be based on the corresponding code in the evaluation visitor: https://github.com/ncalc/ncalc/blob/master/src/NCalc/Domain/EvaluationVisitor.cs#L663-L700
Hello,
I just wanted to get to know if it is possible to get the evaluated expression as a string.
ValueA = 10 ValueB = 15
For example: [ValueA] + [ValueB] Results in: "10 + 15"
This can be really helpful if you want to track down the calculation to see what happened there.