2150 |
mathias |
1 |
if(!dojo._hasResource["dojo.cldr.monetary"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
|
|
2 |
dojo._hasResource["dojo.cldr.monetary"] = true;
|
|
|
3 |
dojo.provide("dojo.cldr.monetary");
|
|
|
4 |
|
|
|
5 |
dojo.cldr.monetary.getData = function(code){
|
|
|
6 |
// summary: A mapping of currency code to currency-specific formatting information. Returns a unique object with properties: places, round.
|
|
|
7 |
// code: an iso4217 currency code
|
|
|
8 |
|
|
|
9 |
// from http://www.unicode.org/cldr/data/common/supplemental/supplementalData.xml:supplementalData/currencyData/fractions
|
|
|
10 |
|
|
|
11 |
var placesData = {
|
|
|
12 |
ADP:0,BHD:3,BIF:0,BYR:0,CLF:0,CLP:0,DJF:0,ESP:0,GNF:0,
|
|
|
13 |
IQD:3,ITL:0,JOD:3,JPY:0,KMF:0,KRW:0,KWD:3,LUF:0,LYD:3,
|
|
|
14 |
MGA:0,MGF:0,OMR:3,PYG:0,RWF:0,TND:3,TRL:0,VUV:0,XAF:0,
|
|
|
15 |
XOF:0,XPF:0
|
|
|
16 |
};
|
|
|
17 |
|
|
|
18 |
var roundingData = {CHF:5};
|
|
|
19 |
|
|
|
20 |
var places = placesData[code], round = roundingData[code];
|
|
|
21 |
if(typeof places == "undefined"){ places = 2; }
|
|
|
22 |
if(typeof round == "undefined"){ round = 0; }
|
|
|
23 |
|
|
|
24 |
return {places: places, round: round}; // Object
|
|
|
25 |
};
|
|
|
26 |
|
|
|
27 |
}
|