Orbeon 表单中的货币格式问题
我正在尝试使用 Orbeon 中的货币字段来显示货币值,例如:$123123213213.00
。我正在尝试这样做:
<fr:currency bind="balance">
<xforms:alert>Required</xforms:alert>
</fr:currency>
我遇到了以下问题:
- 该字段在 17 位数字后失去了精度:
12345678901234567890123
在模糊时更改为12345678901234567000000.00
。 - 我无法使
fr:currency
上的maxlength
属性正常工作。
有没有人遇到过这样的问题并解决了?另外,请告诉我是否有任何替代方案可以解决此问题,例如某些自定义格式。
I am trying to use the currency field in Orbeon to show a value as a currency, e.g.: $123123213213.00
. I am trying to do this with:
<fr:currency bind="balance">
<xforms:alert>Required</xforms:alert>
</fr:currency>
I had the following problems:
- The field has been losing its precision after 17 digits:
12345678901234567890123
changes to12345678901234567000000.00
on blur. - I can't get the
maxlength
attribute on thefr:currency
to work.
Has anyone come across such an issue and happened to solve it? Also, please let me know if there is any alternative to this problem, like some custom formatting.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关于数字精度非常好。现在在 货币组件,并将包含在每夜构建中,从 2011-03-07 开始。有关参考,请参阅提交和错误。
至于有关
maxlength
属性的问题的第二部分,只是fr:currency
不支持任何此类属性。如果你想设置字段的宽度,可以使用CSS。Very good point on the number precision. Support for very large amounts (without any set limit) is now implemented in the currency component, and will be included in nightly builds starting 2011-03-07. For reference, see the commit and bug.
As to the second part of your question regarding the
maxlength
attribute, simply thefr:currency
doesn't support any such attribute. If you want to set the width of the field, you can use CSS.