NCalc计算错误的输入没有可行的替代方案“,” [英] NCalc evaluation error no viable alternative at input ','
问题描述
我试图用评估的前pression NCalc
。
I'm trying to evaluate an expression using NCalc
.
iif(fval(hopo_pfd)="true",fval(hopa_basic)*12%,0)
但是,这离pression正在产生一个错误
But this expression is producing an error
no viable alternative at input ',' at line 1:46
这里声明的所有功能的自定义功能。但该事件 EvaluateFunction
甚至没有提高。请大家帮帮忙。
All functions declared here are custom functions. But the event EvaluateFunction
is not even raised. Please help.
推荐答案
我相信你有无效的语法。这位前pression:未来值(hopa_basic)* 12%
包括模%
运营商,但是你的天堂 T提供的约数。
I believe you have invalid syntax. The expression: fval(hopa_basic)*12%
includes the modulo %
operator, but you haven't provided a divisor.
如果您的意味着的12的百分比的,那么就应该写在一个十进制格式为:未来值(hopa_basic)* 0.12
。
If you meant 12 percent, then it should be written in a decimal format: fval(hopa_basic)*0.12
.
它并没有试图调用 EvaluateFunction
来调用您的自定义功能,是因为它无法解析你的前pression原因的语法,更不用说去执行/解决自定义功能的阶段。
The reason it hasn't attempted to call EvaluateFunction
to call your custom functions is because it failed to parse your expression syntax, let alone get to the stage of executing/resolving custom functions.
这篇关于NCalc计算错误的输入没有可行的替代方案“,”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!