开发者

What's the correct currency format in Belgian Dutch?

开发者 https://www.devze.com 2023-04-07 18:36 出处:网络
I\'m formatting some currency in Java. This piece outputs 9,99 € final NumberFormat 开发者_运维知识库nf = NumberFormat.getCurrencyInstance(new Locale(\"nl\", \"BE\"));

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)


If Wikipedia is to be believed, neither is incorrect:

In Belgian Dutch, the euro sign can go before or after the amount, the latter being more common.


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 for fr-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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号