dijit.form.Number 未正确显示指数形式的数字

发布于 2024-09-14 11:45:11 字数 241 浏览 3 评论 0原文

我有一个数字 Dojo 控件,它显示点后 30 位数字的数字。它正确地格式化数字,但是当数字足够小时,例如8e-13,控件显示类似8e-13,000000000000000000000000000000的内容,而不是0,000000000000800000000000000000。显然它失败并被标记为无效。我尝试将“round:-1”传递给它的约束,但没有任何结果。我还注意到 1.0000000000008 在控件中正确显示。这种奇怪的格式可能是什么原因? 谢谢。

I have a number Dojo control that shows numbers with 30 digits after point. It formats numbers correctly, but when the number is small enough e.g. 8e-13, control shows something like 8e-13,000000000000000000000000000000 rather than 0,000000000000800000000000000000. Apparently it fails and becomes marked as invalid. I tried to pass "round:-1" to its constraints without any result. I also have noticed that 1.0000000000008 is shown correctly in control. What could be the reason of this strange formatting?
Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ι不睡觉的鱼゛ 2024-09-21 11:45:11

Dijit 根本不能很好地处理这些案件。它是为更简单的情况而设计的。正如您所注意到的,指数表示破坏了格式化例程,因此极端数字根本不起作用。有一个以指数表示法格式化数字的选项,但这基本上没有实现。

Dijit simply doesn't handle these cases well. It's designed for more simple cases. Exponential representation breaks the formatting routines, so numbers at the extremes simply don't work, as you've noticed. There is an option for format numbers in their exponential notation, but that's largely unimplemented.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文