META-INF.resources.bower_components.globalize.src.currency.formatter-fn.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-globalize Show documentation
Show all versions of jwebmp-globalize Show documentation
The JWebSwing implementation for a full Globalization
The newest version!
define([
"../common/validate/parameter-presence",
"../common/validate/parameter-type/number",
"./name-format"
], function (validateParameterPresence, validateParameterTypeNumber, currencyNameFormat) {
return function (numberFormatter, pluralGenerator, properties) {
var fn;
// Return formatter when style is "code" or "name".
if (pluralGenerator && properties) {
fn = function currencyFormatter(value) {
validateParameterPresence(value, "value");
validateParameterTypeNumber(value, "value");
return currencyNameFormat(
numberFormatter(value),
pluralGenerator(value),
properties
);
};
// Return formatter when style is "symbol" or "accounting".
} else {
fn = function currencyFormatter(value) {
return numberFormatter(value);
};
}
return fn;
};
});