1 | define(["../_base/kernel", "../_base/lang"], function(dojo, lang){ |
---|
2 | |
---|
3 | // module: |
---|
4 | // dojo/cldr/monetary |
---|
5 | |
---|
6 | var monetary = { |
---|
7 | // summary: |
---|
8 | // TODOC |
---|
9 | }; |
---|
10 | lang.setObject("dojo.cldr.monetary", monetary); |
---|
11 | |
---|
12 | monetary.getData = function(/*String*/ code){ |
---|
13 | // summary: |
---|
14 | // A mapping of currency code to currency-specific formatting information. Returns a unique object with properties: places, round. |
---|
15 | // code: |
---|
16 | // an [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code |
---|
17 | |
---|
18 | // from http://www.unicode.org/cldr/data/common/supplemental/supplementalData.xml:supplementalData/currencyData/fractions |
---|
19 | |
---|
20 | var placesData = { |
---|
21 | ADP:0,AFN:0,ALL:0,AMD:0,BHD:3,BIF:0,BYR:0,CLF:0,CLP:0, |
---|
22 | COP:0,CRC:0,DJF:0,ESP:0,GNF:0,GYD:0,HUF:0,IDR:0,IQD:0, |
---|
23 | IRR:3,ISK:0,ITL:0,JOD:3,JPY:0,KMF:0,KPW:0,KRW:0,KWD:3, |
---|
24 | LAK:0,LBP:0,LUF:0,LYD:3,MGA:0,MGF:0,MMK:0,MNT:0,MRO:0, |
---|
25 | MUR:0,OMR:3,PKR:0,PYG:0,RSD:0,RWF:0,SLL:0,SOS:0,STD:0, |
---|
26 | SYP:0,TMM:0,TND:3,TRL:0,TZS:0,UGX:0,UZS:0,VND:0,VUV:0, |
---|
27 | XAF:0,XOF:0,XPF:0,YER:0,ZMK:0,ZWD:0 |
---|
28 | }; |
---|
29 | |
---|
30 | var roundingData = {}; |
---|
31 | |
---|
32 | var places = placesData[code], round = roundingData[code]; |
---|
33 | if(typeof places == "undefined"){ places = 2; } |
---|
34 | if(typeof round == "undefined"){ round = 0; } |
---|
35 | |
---|
36 | return {places: places, round: round}; // Object |
---|
37 | }; |
---|
38 | |
---|
39 | return monetary; |
---|
40 | }); |
---|