Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#6218 closed defect (invalid)

Mexican Currency formatting wrong

Reported by: guest Owned by: Adam Peller
Priority: high Milestone:
Component: Internationalization Version: 1.0
Keywords: Cc:
Blocked By: Blocking:


This is likley a problem in other locales also. I am testing in FF 2.0.12, with locale es-mx.

I load dojo with djConfig="locale: 'es-mx'" I am using the 1234.56. with: dojo.currency.format(amount, {currency: "MXN"});

The resulting value is: MXN1.234,56

Problems here are: 1) Mexico doesn't use MXM... they use the $ sign. I know recommends something else. Too bad no one on the actual country they are recommending for will know what it means. 2) The locale part is wrong. Mexico should format like 1,234.56. The number is formatted like Spain would be formatted, using "," as the decimal separator.

I understand if there's nothing that can be done for 1) since its based on a standard. Is there some way I can workaround to change the behavior from MXM to $. I don't want to hard code it because I'll use this technique for all currencies, I'm just using MXM as my example.

I think 2) is a real problem though. Any thoughts?

Change History (4)

comment:1 Changed 14 years ago by guest

This problem can be seen on my site @ At the login screen click on the bottom right button, which will log you into a demo account. Each day in the calendar has a currency as account balance.

comment:2 Changed 14 years ago by Adam Peller

1) Dojo only ships configured for a handful of currencies (about 8 at the moment) To get more, you need to run the ant script in util/buildscripts/cldr and set the currency list to include MXN. dojo.currency should then honor Mexican currency symbols for various locales, e.g. "$" for Mexico, "MEX$" for the US. "MXN" is the ISO currency code and is used as a backup if the currency is not configured or perhaps for some locales which do not define it. If you are doing a build of Dojo, you will also need to include your locale for everything to work properly in optimized mode.

2) es-mx should format like 1,234.56. Are you sure that's the locale you have set?

comment:3 Changed 14 years ago by Adam Peller

Resolution: invalid
Status: newclosed

comment:4 Changed 14 years ago by guest

Thanks. I will investigate running the build as you suggest.

Note: See TracTickets for help on using tickets.