The currency formatting class I have applies formatting to a number based on the currency it is. For example:
currency_format(2100000.43,"USD")
is formatted like:
$2,100,000.43
currency_format(2100000.43,"CAD")
C$2,100,000.43
currency_format(2100000.43,"EUR")
2.100.000,43 €
A little online research tells me that these formats aren't always done that way.
In particular, the Euro is used in countries with a variety of languages, and the number formatting preference in those languages is different.
for example:
Swiss:
2'100'000,43 €
German:
2.100.000,43 €
French:
2 100 000,43 €
I don't even know of those are correct.
But it seems apparent that it's not just the currency that matters, it's the currency and the locale, together.
I'm pretty sure someone in Germany - even if they're expressing USD$, would write
2.100.000,43 $USD
Whereas someone in Canada will write:
USD$2,100,000.43
Or does the currency go before the number? What dictates that?
Could you please reply and state, for the record, how currency is expressed in your country?
PHP has a built-in money_format() function, but I don't trust that it's doing the right thing. The manpage comments are full of criticisms and hacks. I'll build my own thanks
Here's mine:
Canadian English
positive:
$12,345.67
or
C$12,345.67
negative:
-$12,345.67
Canadian French
positive:
12.345,67 $
or
12.345,67 C$
negative:
-12.345,67 $