source: Dev/branches/rest-dojo-ui/client/dojo/cldr/monetary.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

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