Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 数值计算结果为NaN #317

Open
leoyzy opened this issue Feb 12, 2025 · 5 comments
Open

🐛 数值计算结果为NaN #317

leoyzy opened this issue Feb 12, 2025 · 5 comments

Comments

@leoyzy
Copy link

leoyzy commented Feb 12, 2025

发生了什么?

有时候,变量和数字的计算结果会变成NaN,重新变更下数字的值后,又会变成正常值;有时得要关闭软件,重新打开,结果才会正常。

系统版本

Windows

附件

No response

@Littlefean
Copy link
Contributor

可以看下工程文件或截图吗

@leoyzy
Copy link
Author

leoyzy commented Feb 24, 2025

请看一下截图和附件

Image

业务逻辑-20250224.json

@Littlefean
Copy link
Contributor

Image

Image

设置变量时,需要保证左边的节点是名称,右边的节点是值。位置按每个节点左上角算。

如果左侧对齐了就反了

不过我刚刚调整了一下顺序发现其他地方还有问题,我再看看

@Littlefean
Copy link
Contributor

Image

把一切位置摆放好了之后,重启软件,没有NaN了。之所以需要重启软件是因为存储的变量是在软件全局内容中了,需要清理掉原来的错误存储的内容。

@Littlefean
Copy link
Contributor

Image

这里有个情况就是:
1:此处左侧对齐了
2:导致“供金泋-收入”这个字符串的值被赋予给了“130469.3”,反了。“130469.3”反而成了变量的名字,它的值成了一个字符串类型。
3:在参与减法计算的时候,看上去是两个数字在做运算,实际上是看上去像数字的变量名在参与运算。
4:字符串不能参与加法运算,进而导致结果是NaN。

接下来我需要优化设置变量的提示和限制变量名不能以数字开头。
并给参与运算的逻辑节点设置详细的出错提示。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 待讨论
Development

No branches or pull requests

2 participants