比利时荷兰语的正确货币格式是什么?
我正在用 Java 格式化一些货币。这件作品输出 9,99 €,
final NumberFormat nf = NumberFormat.getCurrencyInstance(new Locale("nl", "BE"));
nf.setCurrency(EUR);
nf.format(new BigDecimal("9.99"));
但我们的支付提供商之一返回预先格式化的金额,输出 € 9,99
对于 nl-BE
来说,哪一个是正确的?
更多与编程相关的内容,如果事实证明支付提供商(而不是 Java)是正确的,我如何修复 Java 方式而不需要对每个语言环境进行黑客攻击(在实际代码中,比利时的荷兰语语言环境不是硬编码)
I'm formatting some currency in Java. This piece outputs 9,99 €
final NumberFormat nf = NumberFormat.getCurrencyInstance(new Locale("nl", "BE"));
nf.setCurrency(EUR);
nf.format(new BigDecimal("9.99"));
but one of our payment providers, which returns amounts preformatted, outputs € 9,99
Which is correct for nl-BE
?
And more programming related, if it turns out the payment provider, and not Java, is correct, how do I fix the Java way without hacks per locale (in the real code the Dutch in Belgium locale is not hardcoded)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果维基百科是可信的,那么两者都不正确:
If Wikipedia is to be believed, neither is incorrect:
简短的回答:没人关心。你可以使用任何人。
较长的答案:如果金额出现在句子中,则 9,99 € 更为常见。如果它位于发票底部,则两者都会使用。不用等,您甚至可以使用欧元代替欧元。
顺便说一句,大多数人甚至期望 9.99 欧元而不是 9,99 欧元,仅仅是因为 区域设置数据的发明晚了 25 年。
请注意,这是一个
fr-BE
人的观点;-)我认为在这种情况下,语言环境信息试图过多地区分邻近文化。想想键盘:有一种用于
fr-FR
的布局,也有一种用于fr-BE
的布局。字母、数字和大多数标点符号位于同一位置,但少数字符如 <、> 或 @ 位于不同位置在键盘上。卧槽!Short answer: Nobody cares. You can use anyone.
Somewhat longer answer: If the amount appears in a sentence, 9,99 € is more usual. If it's at the bottom of an invoice, both are used. No wait, you could even use EUR instead of €.
BTW, most people even expect 9.99 € instead of 9,99€ simply because locale data was invented 25 years late.
Be aware though that this is the opinion of a
fr-BE
guy ;-)This is the kind of stuff where I believe locale info tries too much to differentiate neighbouring cultures. Think of keyboards: There is a layout for
fr-FR
and one forfr-BE
. Letters, digits and most punctuation signs are at the same position but a few characters such as <, > or @ are at different position on the keyboard. WTF!