NCalc计算错误的输入没有可行的替代方案“,”错误、方案、NCalc

由网友(越难忘。就越难忘)分享简介:我试图用评估的前pression NCalc 。I'm trying to evaluate an expression using NCalc.iif(fval(hopo_pfd)="true",fval(hopa_basic)*12%,0)但是,这离pression正在产生一个错误But this expr...

我试图用评估的前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.

阅读全文

相关推荐

最新文章