META-INF.resources.bower_components.globalize.dist.globalize-runtime.currency.min.js Maven / Gradle / Ivy
(function(root,factory){if(typeof define==="function"&&define.amd){define(["../globalize-runtime","./number"],factory)}else if(typeof exports==="object"){module.exports=factory(require("../globalize-runtime"),require("./number"))}else{factory(root.Globalize)}})(this,function(Globalize){var formatMessage=Globalize._formatMessage,runtimeKey=Globalize._runtimeKey,validateParameterPresence=Globalize._validateParameterPresence,validateParameterTypeNumber=Globalize._validateParameterTypeNumber;var currencyNameFormat=function(formattedNumber,pluralForm,properties){var displayName,unitPattern,displayNames=properties.displayNames||{},unitPatterns=properties.unitPatterns;displayName=displayNames["displayName-count-"+pluralForm]||displayNames["displayName-count-other"]||displayNames.displayName||properties.currency;unitPattern=unitPatterns["unitPattern-count-"+pluralForm]||unitPatterns["unitPattern-count-other"];return formatMessage(unitPattern,[formattedNumber,displayName])};var currencyFormatterFn=function(numberFormatter,pluralGenerator,properties){var fn;if(pluralGenerator&&properties){fn=function currencyFormatter(value){validateParameterPresence(value,"value");validateParameterTypeNumber(value,"value");return currencyNameFormat(numberFormatter(value),pluralGenerator(value),properties)}}else{fn=function currencyFormatter(value){return numberFormatter(value)}}return fn};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 - 2025 Weber Informatics LLC | Privacy Policy