var AdfDvtValueFormat=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r,w,v,x,z,t,B,F,D,A){a=void 0!==a?a:1;b=void 0!==b?b:null;c=void 0!==c?c:null;d=void 0!==d?d:this.SFSYM_K;e=void 0!==e?e:this.SFSYM_M;f=void 0!==f?f:this.SFSYM_B;g=void 0!==g?g:this.SFSYM_T;h=void 0!==h?h:this.SFSYM_Q;l=void 0!==l?l:"";m=void 0!==m?m:"";n=void 0!==n?n:"";p=void 0!==p?p:"";q=void 0!==q?q:3;r=void 0!==r?r:0;w=void 0!==w?w:340;v=void 0!==v?v:1;x=void 0!==x?x:390;z=void 0!==z?z:"0";t=void 0!==t?t:!0;B=void 0!==B?B:"";F=void 0!==
F?F:NaN;D=void 0!==D?D:!1;this._nBaseMultiplier=this._nMultiplier=NaN;this._iMaxIntLen=this._iMinIntLen=this._iMaxFractLen=this._iMinFractLen=0;this._sPadSymbol=null;this._bShowScaleSymbol=!1;this._negSuffix=this._negPrefix=this._posSuffix=this._posPrefix=this._groupSeparator=this._decSymbol=this._sInvalidValueSym=null;this._iGroupSize=3;this._bIsPowerPlusTwo=!1;this._scaleFlag=this.SF_NONE;this._arScaleSymbols=[d,e,f,g,h];this._decDigits=0;this._round=.5;this._origDecDigits=this._origScaleFlag=this._power=
0;this._maxAxisValue=this._minAxisValue=this._origMultiplier=NaN;this._bDefault=0===arguments.length;this.SF_AUTO=0;this.SF_NONE=1;this.SF_K=2;this.SF_M=3;this.SF_B=4;this.SF_T=5;this.SF_Q=6;this.SF_SPECIFIED=99;this.SFSYM_K="K";this.SFSYM_M="M";this.SFSYM_B="B";this.SFSYM_T="T";this.SFSYM_Q="Q";this.cPERIOD=".";this.cCOMMA=",";this.cZEROS="000000000000000000000000000000";this.cEMPTY="";this.cTRUE="t";this.cE="e";this._nMultiplier=a;this._iGroupSize=q;this._iMinFractLen=r;this._iMaxFractLen=w;this._iMinIntLen=
v;this._iMaxIntLen=x;this._sPadSymbol=z;this._bShowScaleSymbol=t;this._nBaseMultiplier=1===F?NaN:F;this._bIsPowerPlusTwo=D;this._roundingMode=A;var y;if(isNaN(a))y=this.SF_AUTO,this._nMultiplier=1;else if(1===a)y=this.SF_NONE;else if(y=this.SF_SPECIFIED,t)switch(a){case .001:y=this.SF_K;break;case 1E-6:y=this.SF_M;break;case 1E-9:y=this.SF_B;break;case 1E-12:y=this.SF_T;break;case 1E-15:y=this.SF_Q}this._scaleFlag=y;var E=0;-1!==this._iMinFractLen&&(this._iMinFractLen>this._iMaxFractLen&&(this._iMaxFractLen=
this._iMinFractLen),this._iMinFractLen===this._iMaxFractLen?E=this._iMinFractLen:this._iMinFractLen<this._iMaxFractLen&&(E=this._iMaxFractLen));-1===this._iMinFractLen&&(E=-1);this._origScaleFlag=y;this._origMultiplier=this._nMultiplier;this._decDigits=this._origDecDigits=E;this._decSymbol=null===b?this.cPERIOD:b;-1!==E&&(this._round=Math.pow(10,E));this._groupSeparator=c;null===l&&(l=this.cEMPTY);null===m&&(m=this.cEMPTY);null===n&&(n=this.cEMPTY);null===p&&(p=this.cEMPTY);this._posPrefix=l;this._posSuffix=
m;this._negPrefix=n;this._negSuffix=p};AdfDvtValueFormat.prototype._autoDecDigits=function(a){var b=0;this._power=this._getPowerOfTen(a);this._bIsPowerPlusTwo&&(this._power+=2);b=2>=this._power?3-this._power:16<=this._power?3>this._power-15?3-(this._power-15):0:3-(this._power-3*Math.floor((this._power-1)/3));-1===this._decDigits&&(this._decDigits=b);0!==this._decDigits&&(this._round=Math.pow(10,this._decDigits))};
AdfDvtValueFormat.prototype._autoScale=function(a){var b=!1;if(!isNaN(this._maxAxisValue)&&!isNaN(this._minAxisValue)){a=Math.abs(this._minAxisValue);var c=Math.abs(this._maxAxisValue);a=c>a?c:a;this._maxAxisValue=this._minAxisValue=NaN}this._power=this._getPowerOfTen(a);this._bIsPowerPlusTwo&&(this._power+=2);if(2>=this._power)this._scaleFlag=this.SF_NONE,this._nMultiplier=1,-1===this._decDigits&&(this._decDigits=3-this._power);else if(16<=this._power)this._scaleFlag=this.SF_Q,-1===this._decDigits&&
(this._decDigits=3>this._power-15?3-(this._power-15):0),this._nMultiplier=1E-15,b=!0;else{a=3*Math.floor((this._power-1)/3);switch(a){case 3:this._scaleFlag=this.SF_K;this._nMultiplier=.001;b=!0;break;case 6:this._scaleFlag=this.SF_M;this._nMultiplier=1E-6;b=!0;break;case 9:this._scaleFlag=this.SF_B;this._nMultiplier=1E-9;b=!0;break;case 12:this._scaleFlag=this.SF_T;this._nMultiplier=1E-12;b=!0;break;case 15:this._scaleFlag=this.SF_Q;this._nMultiplier=1E-15;b=!0;break;default:this._scaleFlag=this.SF_NONE}-1===
this._decDigits&&(this._decDigits=3-(this._power-a))}0!==this._decDigits&&(this._round=Math.pow(10,this._decDigits));return b};
AdfDvtValueFormat.prototype.getFormattedValue=function(a,b,c){b=void 0!==b?b:NaN;c=void 0!==c?c:NaN;var d,e=!1,f=!1,g=this._iMinFractLen,h=this._iMaxFractLen;if(isNaN(a)||!isFinite(a))return this._sInvalidValueSym;this._minAxisValue=b;this._maxAxisValue=c;this._scaleFlag=this._origScaleFlag;if(this._scaleFlag===this.SF_AUTO||this._scaleFlag!==this.SF_AUTO&&-1===g)this._power=0,this._scaleFlag===this.SF_AUTO&&(this._nMultiplier=1),this._decDigits=this._origDecDigits,this._nMultiplier=this._origMultiplier;
0>a&&(a=-a,e=!0);this._scaleFlag!==this.SF_AUTO&&-1===g&&(this._autoDecDigits(a),a*=this._nMultiplier,f=!0,-1==g&&(g=this._decDigits),-1===h&&(h=this._decDigits),this._round=Math.pow(10,this._decDigits));this._scaleFlag===this.SF_AUTO&&(this._autoScale(a),-1===g&&(g=this._decDigits),-1===h&&(h=this._decDigits),this._round=Math.pow(10,this._decDigits));f||this._scaleFlag===this.SF_NONE||1===this._nMultiplier||(b=0<this._decDigits?this._decDigits+3:3,a=a*this._nMultiplier*Math.pow(10,b),a/=Math.pow(10,
b));isNaN(this._nBaseMultiplier)||(a*=this._nBaseMultiplier);if(isNaN(a)||!isFinite(a))return this._sInvalidValueSym;a*=this._round;a=e?"c"==this._roundingMode||"d"==this._roundingMode?Math.floor(a):"f"==this._roundingMode||"u"==this._roundingMode?Math.ceil(a):"hu"==this._roundingMode||"he"==this._roundingMode&&1.5===a%2?Math.round(a):-1*Math.round(-1*a):"f"==this._roundingMode||"d"==this._roundingMode?Math.floor(a):"c"==this._roundingMode||"u"==this._roundingMode?Math.ceil(a):"hd"==this._roundingMode||
"he"==this._roundingMode&&.5===a%2?-1*Math.round(-1*a):Math.round(a);a/=this._round;b=a+"";f=b.indexOf(this.cPERIOD);c=0;0>this._power&&(d=b.indexOf(this.cE),0<d&&(b=b.substr(0,d),d=-this._power-f,0<d&&(b=this.cPERIOD+this.cZEROS.substring(0,d)+b.substr(0,f)+b.substr(f+1),f=0)));if(0===g&&0===h)0<=f&&(b=b.substring(0,f));else if(0<=f)if(c=b.length-1-f,c<g)if(c=g-c,"0"===this._sPadSymbol&&c<=this.cZEROS.length)b+=this.cZEROS.substr(0,c);else for(d=c;0<d;d--)b+=this._sPadSymbol;else{if(c>h){d=f+g+1;
for(var l=b.length;d<l;){if("0"!==b.charAt(d)){l=0;break}d++}b=b.substring(0,f+(0===l?h:g)+1)}}else if(0<g){b+=this._decSymbol;if("0"===this._sPadSymbol&&g<=this.cZEROS.length)b+=this.cZEROS.substr(0,g);else for(d=this._iMinFractLen;0<d;d--)b+=this._sPadSymbol;f=b.length-g-1}var g=0,m,h=0,g=0<=f?f:b.length,h=this._iMaxIntLen;1===g&&0===this._iMinIntLen&&1>Math.abs(a)&&0<=f&&(h=0);if(g<this._iMinIntLen){g=this._iMinIntLen-g;if("0"===this._sPadSymbol&&g<=this.cZEROS.length)m=this.cZEROS.substr(0,g);
else for(d=g;0<d;d--)m+=this._sPadSymbol;b=m+b;0<=f&&(f+=g)}else g>h&&(g-=h,b=b.substring(g),0<=f&&(f-=g));if(null!==this._groupSeparator&&0<this._iGroupSize&&(0>f&&(f=b.length),f>this._iGroupSize)){a=f-this._iGroupSize;m=b.substring(a);for(f=this.cEMPTY;;){m=f+m;a-=this._iGroupSize;if(0>=a){a+=this._iGroupSize;m=b.substring(0,a)+this._groupSeparator+m;break}f=b.substr(a,this._iGroupSize)+this._groupSeparator}b=m}0<c&&null!==this._decSymbol&&(f=b.lastIndexOf(this.cPERIOD),0<=f&&(a=this.cEMPTY,m=b.substr(0,
f),++f<=b.length&&(a=b.substr(f)),b=m+this._decSymbol+a));this._bShowScaleSymbol&&this._scaleFlag>=this.SF_K&&this._scaleFlag<=this.SF_Q&&(a=this._arScaleSymbols[this._scaleFlag-this.SF_K],null!==a&&(b+=a));e?(b=this._negPrefix+b,b+=this._negSuffix):(b=this._posPrefix+b,b+=this._posSuffix);return b};AdfDvtValueFormat.prototype._getPowerOfTen=function(a){var b=0;10<=a?(a=Math.floor(a),b=a.toString().length-1):1>a&&0!==a&&(b=a.toExponential(),a=b.indexOf("e"),b=parseInt(b.substr(a+1),10));return b};
AdfDvtValueFormat.prototype.isDefault=function(){return this._bDefault};AdfDvtValueFormat.prototype.setDefault=function(a){this._bDefault=a};AdfDvtValueFormat.prototype.getAsString=function(a){return this.getFormattedValue(a)};