summaryrefslogtreecommitdiff
path: root/lib/dojo/currency.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-08-14 18:59:10 +0400
committerAndrew Dolgov <[email protected]>2012-08-14 18:59:18 +0400
commit1354d17270961fff662d40f90521223f8fd0d73b (patch)
treee9266be71587e47c800303446e968a6d3565e2cf /lib/dojo/currency.js
parentd04f8c826f5283765f52cf6b98b42a1ed8f2d6bc (diff)
update dojo to 1.7.3
Diffstat (limited to 'lib/dojo/currency.js')
-rw-r--r--lib/dojo/currency.js136
1 files changed, 2 insertions, 134 deletions
diff --git a/lib/dojo/currency.js b/lib/dojo/currency.js
index 8ae564618..4e9e249a9 100644
--- a/lib/dojo/currency.js
+++ b/lib/dojo/currency.js
@@ -4,137 +4,5 @@
see: http://dojotoolkit.org/license for details
*/
-
-if(!dojo._hasResource["dojo.currency"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.currency"] = true;
-dojo.provide("dojo.currency");
-dojo.require("dojo.number");
-dojo.require("dojo.i18n");
-dojo.requireLocalization("dojo.cldr", "currency", null, "ROOT,ar,ca,cs,da,de,el,en,en-au,en-ca,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,ro,ru,sk,sl,sv,th,tr,zh,zh-hant,zh-hk,zh-tw");
-dojo.require("dojo.cldr.monetary");
-
-dojo.getObject("currency", true, dojo);
-
-/*=====
-dojo.currency = {
- // summary: localized formatting and parsing routines for currencies
- //
- // description: extends dojo.number to provide culturally-appropriate formatting of values
- // in various world currencies, including use of a currency symbol. The currencies are specified
- // by a three-letter international symbol in all uppercase, and support for the currencies is
- // provided by the data in `dojo.cldr`. The scripts generating dojo.cldr specify which
- // currency support is included. A fixed number of decimal places is determined based
- // on the currency type and is not determined by the 'pattern' argument. The fractional
- // portion is optional, by default, and variable length decimals are not supported.
-}
-=====*/
-
-dojo.currency._mixInDefaults = function(options){
- options = options || {};
- options.type = "currency";
-
- // Get locale-dependent currency data, like the symbol
- var bundle = dojo.i18n.getLocalization("dojo.cldr", "currency", options.locale) || {};
-
- // Mixin locale-independent currency data, like # of places
- var iso = options.currency;
- var data = dojo.cldr.monetary.getData(iso);
-
- dojo.forEach(["displayName","symbol","group","decimal"], function(prop){
- data[prop] = bundle[iso+"_"+prop];
- });
-
- data.fractional = [true, false];
-
- // Mixin with provided options
- return dojo.mixin(data, options);
-};
-
-/*=====
-dojo.declare("dojo.currency.__FormatOptions", [dojo.number.__FormatOptions], {
- // type: String?
- // Should not be set. Value is assumed to be "currency".
- // symbol: String?
- // localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
- // A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
- // currency: String?
- // an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
- // For use with dojo.currency only.
- // places: Number?
- // number of decimal places to show. Default is defined based on which currency is used.
- type: "",
- symbol: "",
- currency: "",
- places: ""
-});
-=====*/
-
-dojo.currency.format = function(/*Number*/value, /*dojo.currency.__FormatOptions?*/options){
-// summary:
-// Format a Number as a currency, using locale-specific settings
-//
-// description:
-// Create a string from a Number using a known, localized pattern.
-// [Formatting patterns](http://www.unicode.org/reports/tr35/#Number_Elements)
-// appropriate to the locale are chosen from the [CLDR](http://unicode.org/cldr)
-// as well as the appropriate symbols and delimiters and number of decimal places.
-//
-// value:
-// the number to be formatted.
-
- return dojo.number.format(value, dojo.currency._mixInDefaults(options));
-};
-
-dojo.currency.regexp = function(/*dojo.number.__RegexpOptions?*/options){
-//
-// summary:
-// Builds the regular needed to parse a currency value
-//
-// description:
-// Returns regular expression with positive and negative match, group and decimal separators
-// Note: the options.places default, the number of decimal places to accept, is defined by the currency type.
- return dojo.number.regexp(dojo.currency._mixInDefaults(options)); // String
-};
-
-/*=====
-dojo.declare("dojo.currency.__ParseOptions", [dojo.number.__ParseOptions], {
- // type: String?
- // Should not be set. Value is assumed to be currency.
- // currency: String?
- // an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD".
- // For use with dojo.currency only.
- // symbol: String?
- // localized currency symbol. The default will be looked up in table of supported currencies in `dojo.cldr`
- // A [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code will be used if not found.
- // places: Number?
- // fixed number of decimal places to accept. The default is determined based on which currency is used.
- // fractional: Boolean?|Array?
- // Whether to include the fractional portion, where the number of decimal places are implied by the currency
- // or explicit 'places' parameter. The value [true,false] makes the fractional portion optional.
- // By default for currencies, it the fractional portion is optional.
- type: "",
- currency: "",
- symbol: "",
- places: "",
- fractional: ""
-});
-=====*/
-
-dojo.currency.parse = function(/*String*/expression, /*dojo.currency.__ParseOptions?*/options){
- //
- // summary:
- // Convert a properly formatted currency string to a primitive Number,
- // using locale-specific settings.
- //
- // description:
- // Create a Number from a string using a known, localized pattern.
- // [Formatting patterns](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
- // are chosen appropriate to the locale, as well as the appropriate symbols and delimiters
- // and number of decimal places.
- //
- // expression: A string representation of a currency value
-
- return dojo.number.parse(expression, dojo.currency._mixInDefaults(options));
-};
-
-}
+//>>built
+define("dojo/currency",["./_base/kernel","./_base/lang","./_base/array","./number","./i18n","./i18n!./cldr/nls/currency","./cldr/monetary"],function(_1,_2,_3,_4,_5,_6,_7){_2.getObject("currency",true,_1);_1.currency._mixInDefaults=function(_8){_8=_8||{};_8.type="currency";var _9=_5.getLocalization("dojo.cldr","currency",_8.locale)||{};var _a=_8.currency;var _b=_7.getData(_a);_3.forEach(["displayName","symbol","group","decimal"],function(_c){_b[_c]=_9[_a+"_"+_c];});_b.fractional=[true,false];return _2.mixin(_b,_8);};_1.currency.format=function(_d,_e){return _4.format(_d,_1.currency._mixInDefaults(_e));};_1.currency.regexp=function(_f){return _4.regexp(_1.currency._mixInDefaults(_f));};_1.currency.parse=function(_10,_11){return _4.parse(_10,_1.currency._mixInDefaults(_11));};return _1.currency;}); \ No newline at end of file