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)
The euro banknotes and coins were introduced in Belgium on 1 January 2002, after a transitional period of three years when the euro was the official currency but only existed as 'book money'.
Write the country symbol ( US ) first, immediately followed by the dollar sign ($) and the dollar figure: US$ 25.99.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With