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

META-INF.resources.bower_components.globalize.src.currency.symbol-properties.min.js Maven / Gradle / Ivy

There is a newer version: 0.66.0.1
Show newest version
define(["./supplemental-override","../number/numbering-system","../util/regexp/not-s"],function(currencySupplementalOverride,numberNumberingSystem,regexpNotS){return function(currency,cldr,options){var currencySpacing,pattern,regexp={"[:digit:]":/\d/,"[:^S:]":regexpNotS},symbol=cldr.main(["numbers/currencies",currency,"symbol"]);currencySpacing=["beforeCurrency","afterCurrency"].map(function(position){return cldr.main(["numbers","currencyFormats-numberSystem-"+numberNumberingSystem(cldr),"currencySpacing",position])});pattern=cldr.main(["numbers","currencyFormats-numberSystem-"+numberNumberingSystem(cldr),options.style==="accounting"?"accounting":"standard"]);pattern=currencySupplementalOverride(currency,pattern,cldr).split(";").map(function(pattern){return pattern.split("¤").map(function(part,i){var currencyMatch=regexp[currencySpacing[i].currencyMatch],surroundingMatch=regexp[currencySpacing[i].surroundingMatch],insertBetween="";currencyMatch=currencyMatch.test(symbol.charAt(i?symbol.length-1:0));surroundingMatch=surroundingMatch.test(part.charAt(i?0:part.length-1).replace(/[#@,.]/g,"0"));if(currencyMatch&&part&&surroundingMatch){insertBetween=currencySpacing[i].insertBetween}return(i?insertBetween:"")+part+(i?"":insertBetween)}).join("'"+symbol+"'")}).join(";");return{pattern:pattern}}});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy