All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.globalize.src.currency-runtime.js Maven / Gradle / Ivy

The newest version!
define([
    "./common/runtime-key",
    "./common/validate/parameter-presence",
    "./common/validate/parameter-type/number",
    "./core-runtime",
    "./currency/formatter-fn",
    "./currency/name-format",

    "./number-runtime"
], function (runtimeKey, validateParameterPresence, validateParameterTypeNumber, Globalize,
             currencyFormatterFn, currencyNameFormat) {

    Globalize._currencyFormatterFn = currencyFormatterFn;
    Globalize._currencyNameFormat = currencyNameFormat;

    Globalize.currencyFormatter =
        Globalize.prototype.currencyFormatter = function (currency, options) {
            options = options || {};
            return Globalize[runtimeKey("currencyFormatter", this._locale, [currency, options])];
        };

    Globalize.formatCurrency =
        Globalize.prototype.formatCurrency = function (value, currency, options) {
            validateParameterPresence(value, "value");
            validateParameterTypeNumber(value, "value");

            return this.currencyFormatter(currency, options)(value);
        };

    return Globalize;

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy