Except US Dollar, all currencies using the '$' dollar symbol are prefixed with their country name (eg. AU$, HK$). Similarly, currencies sharing other symbols (eg. '£' , '¥') are also prefixed in the same way.
So for an Canadian site using Canadian Dollar as default but also allow international customers to view in their own currencies. The formatted output is presented as:
CA$100
$101.94
AU$97.63
£62.78
This is totally wrong. The currency symbols should be how they are presented locally, instead of how the US presents foreign currencies.
There would be a confusion for sites using multiple currencies. A possible solution to this problem is the default currency always get to use the symbol without a prefix and additional allowed currencies are presented using the 3 letter currency code.
So for a Canadian site, the formatted output should be:
$100
$101.94 USD
$97.63 AUD
£62.78 GBP
Comment | File | Size | Author |
---|---|---|---|
#7 | 1551032.aud_.patch | 538 bytes | rszrama |
Comments
Comment #0.0
SeriousMatters CreditAttribution: SeriousMatters commentedadded examples
Comment #1
brianV CreditAttribution: brianV commentedJust bumping this. I have a Canadian site, and it's rediculous to me that all my prices are represented as:
50.00 CAD
When they should be represented as:
$50.00
I'm actually bumping this to major, since this is a big issue for non-US sites. We can't even display our currency the way every other place in our country does!
Comment #2
rszrama CreditAttribution: rszrama commentedHey Brian, if you don't mind, please open a separate issue following the instructions at http://www.drupalcommerce.org/faq/currency-format.
Comment #3
m4oliveiHey,
I have a Canadian site as well. Maybe the default for Canada is a bit silly in most cases, but there are hooks provided that let you display your currency however you like. Perhaps it would make a good add on module. In any case, here is an example of what I did:
I'm altering the CAD currency here, but it would work equally well for other currencies. Note that any change you make to this alter hook requires a clearing your cache for the change to show up on the site, as Commerce caches all this currency information. See commerce.api.php for more details.
Comment #4
SeriousMatters CreditAttribution: SeriousMatters commentedm4olivei,
As far as I know, there is no single format that would please everyone. Take Canadian dollar for example, the $ sign is placed before number for English speaking community but after the number for French speaking community. But that is a customisation question.
I know the currency display can be customised via hook, patch, hack... There are many other topics on patching/customising the currency output already. But this issue is not about customisation. This issue is about a design error that may cause serious problem to sites that works with multiple currencies.
eg, a site showing something in 2 currencies could be mistaken as the same currency + tax
eg2. In a multi-lingual site using the same US Dollar, the Chinese version displays $100 USD while en-us version displays $100.
There are quite a lot of things to consider. Perhaps we need to include the 'default currency' into the formatting logic. I do not have a solid analysis on the issue as I don't have a multilingual Commerce site yet (planning one soon). For now, I am just pointing out that something needs to be done about it.
P.S. maybe change title to something more fitting?
Comment #5
m4oliveiI hear ya. Just putting in an alternative for people like me that landed here after a google search. I think the info and alter hooks provided could be used to write a contrib module with an interface for setting this stuff.
Comment #6
jlhs CreditAttribution: jlhs commentedAlthough as commerce currently stands, price as xx.xx AUD is better than it used to be which was AU$xx.xx
Really a dollar sign should be at the front always for a an Australian Dollar amount. Having $xx.xx AUD simply by adding a dollar sign at the front would be an excellent improvement and stop people having go into the code to do this everytime the module is updated. If you make this permanent, no Australian is going to complain, as we always start prices with a dollar sign. simply by doing the below solves this issue, but it needs to be made a permanent fix, as if someone updates the module it will just be overridden. Trust me, every single Australian user will want a dollar sign at the front (Aussies will be relieved not frustrated at seeing the dollar sign). Having no dollar sign is not good, not good at all...
Ultra simple fix as below, just needs to be put in permanently be developers, still having AUD at the end as well as the dollar sign will not conflict with the US dollar :
'AUD' => array(
'code' => 'AUD',
'symbol' => '$',
'name' => t('Australian Dollar'),
'numeric_code' => '036',
'symbol_placement' => 'before',
'minor_unit' => t('Cent'),
'major_unit' => t('Dollar'),
),
Comment #7
rszrama CreditAttribution: rszrama commentedJust to be clear here, would Australian Drupal Commerce developers love this patch?
Comment #8
larowlanSpeaking as an AU developer.
There's an alter hook for hook_commerce_currency_info() : http://drupalcontrib.org/api/drupal/contributions!commerce!commerce.api....
If so, this is superfluos - implement the alter hook, remove the AU, problem solved.
In my opinion thats 'closed won't fix'
Comment #9
rszrama CreditAttribution: rszrama commentedWell, I'm happy to have it fixed in the core to prevent that if there's no compelling reason to leave it the way it is. I suppose it's worth leaving alone if Australian sites typically involve multiple types of Dollars and always represent Australian dollars as AUD - but I believe the intention is really for the currency info array to represent the formatting of a currency in its home market. (See for example the Swiss Franc, which uses the Fr. symbol instead of CHF even though there are other types of Francs.)
Comment #10
benjy CreditAttribution: benjy commentedI'm all for this patch. We certainly always change it to $200 AUD for multi-currency websites and usually $200 for sites only trading in Australia.
+1 from me.
Comment #11
rcross CreditAttribution: rcross commented+1 for this patch. While its easy to change/override, the majority of customers we've worked with don't want the "AU$" style so this would represent an improvement to the common use case in Australia.
Comment #12
rszrama CreditAttribution: rszrama commentedThanks for the feedback, folks. Putting it in; note that this won't mess up any site currently altering, but it could help ya do less altering in the future. : )
Comment #13
SeriousMatters CreditAttribution: SeriousMatters commentedThanks for the fix. But there are about 30 currencies using the dollar $ sign. Should we raise a new issue for each of these currencies? And also for each of the many £ and ¥ currencies as well?
Comment #14
rszrama CreditAttribution: rszrama commentedWe've basically followed the policy at http://www.drupalcommerce.org/faq/currency-format, which is that if there is a standard format for a currency in its home market, we should use it. However, we haven't intentionally pursued trying to figure this out for every currency, waiting for someone with a specific site in development who knows the market to advise us of the format. That happened here, but I don't care to write one giant patch that does it for all currencies without local insight. imo, it's better to use the generic format than to suddenly change to an incorrect one.
Comment #15.0
(not verified) CreditAttribution: commentedchanged formatting