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

META-INF.resources.bower_components.globalize.src.number.format-properties.min.js Maven / Gradle / Ivy

The newest version!
define(["./numbering-system-digits-map","./pattern-properties","./symbol","./symbol/map","./symbol/name","../util/number/round"],function(numberNumberingSystemDigitsMap,numberPatternProperties,numberSymbol,numberSymbolMap,numberSymbolName,numberRound){return function(pattern,cldr,options){var negativePattern,negativePrefix,negativeProperties,negativeSuffix,positivePattern,roundFn,properties;function getOptions(attribute,propertyIndex){if(attribute in options){properties[propertyIndex]=options[attribute]}}options=options||{};pattern=pattern.split(";");positivePattern=pattern[0];negativePattern=pattern[1]||"-"+positivePattern;negativeProperties=numberPatternProperties(negativePattern);negativePrefix=negativeProperties[0];negativeSuffix=negativeProperties[10];roundFn=numberRound(options.round);roundFn.generatorString=function(){return"numberRound("+(options.round?'"'+options.round+'"':"")+")"};properties=numberPatternProperties(positivePattern).concat([positivePattern,negativePrefix+positivePattern+negativeSuffix,negativePrefix,negativeSuffix,roundFn,numberSymbol("infinity",cldr),numberSymbol("nan",cldr),numberSymbolMap(cldr),numberNumberingSystemDigitsMap(cldr)]);getOptions("minimumIntegerDigits",2);getOptions("minimumFractionDigits",3);getOptions("maximumFractionDigits",4);getOptions("minimumSignificantDigits",5);getOptions("maximumSignificantDigits",6);if(options.useGrouping===false){properties[8]=null}if("minimumFractionDigits"in options&&!("maximumFractionDigits"in options)){properties[4]=Math.max(properties[3],properties[4])}else if(!("minimumFractionDigits"in options)&&"maximumFractionDigits"in options){properties[3]=Math.min(properties[3],properties[4])}return properties}});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy