text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See http://js.arcgis.com/3.34/esri/copyright.txt for details.
  //>>built
  define("esri/dijit/geoenrichment/ReportPlayer/core/supportClasses/templateJsonUtils/fieldInfo/FieldInfoFormatUtil",["esri/dijit/geoenrichment/ReportPlayer/countryConfig","esri/dijit/geoenrichment/utils/ObjectUtil","../../../grid/coreUtils/GridDataUtil","dojo/i18n!esri/nls/jsapi"],function(e,h,k,f){f=f.geoenrichment.dijit.ReportPlayer.ReportPlayer;var g={processFieldInfoTagAttributes:function(a){a&&!a.m&&(a.decimals||a.symbol||a.thousands)&&(a.m={showCurrency:"currency"===a.symbol,showPercent:"percent"===
  a.symbol,useThousandsSeparator:!1!==a.thousands,decimals:Number(a.decimals)||0})},buildFormatStringFromFieldInfo:function(a){if(a){if(a.format)return a.format;if(k.isNumericVariableFieldCell(a)){var b=a.decimals,c=a.showCurrency,e=a.showPercent;a=!!a.useThousandsSeparator;var d="";c&&(d+="\\$");a&&(d+="#,#");d+="0";if(0<b)for(d+=".";b--;)d+="0";!c&&e&&(d+="\\%");return d}}},setFieldInfoFormat:function(a,b){b&&"object"===typeof b?(a.showCurrency=b.showCurrency,a.showPercent=b.showPercent,a.useThousandsSeparator=
  !!b.useThousandsSeparator,a.decimals=Number(b.decimals)||0):"string"===typeof b&&(a.showCurrency=-1!==b.indexOf("$"),a.showPercent=-1!==b.indexOf("%"),a.useThousandsSeparator=-1!==b.indexOf("#,#"),a.decimals=0,-1!==b.indexOf("0.")&&(a.decimals=b.split("0").length-2))},formatNumber:function(a,b,c){if(b.isMissing)return f.missingVariable;a=h.formatNumber(a,{places:b.decimals||0,noSeparator:!b.useThousandsSeparator,preserveTrailingZeroes:!0});return g.providePercentCurrencySymbols(a,b,c)},providePercentCurrencySymbols:function(a,
  b,c){if(!a)return a;if(b.showCurrency)return b=!1,"-"===a.charAt(0)&&(b=!0,a=a.substr(1)),c&&c.placePercentCurrencyInFront?b?"-"+e.getCurrencySymbol()+a:e.getCurrencySymbol()+a:e.getCurrencyFormat().split(";")[b?1:0].replace("0",a);b.showPercent&&(a=c&&c.placePercentCurrencyInFront?"%"+a:a+"%");return a}};return g});