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

META-INF.adf.jsLibs.NumberFormat.js Maven / Gradle / Ivy

The newest version!
function TrNumberFormat(a0,a1)
{
if(!a0)
alert("type for TrNumberFormat not defined!");
this._type=a0;
this._localeSymbols=getLocaleSymbols(a1);
this._pPre=this._localeSymbols.getPositivePrefix();
this._pSuf=this._localeSymbols.getPositiveSuffix();
this._nPre=this._localeSymbols.getNegativePrefix();
this._nSuf=this._localeSymbols.getNegativeSuffix();
this._maxFractionDigits=3;
this._maxIntegerDigits=40;
if(this._type=="currency")
{
this._minFractionDigits=2;
}
else
{
this._minFractionDigits=0;
}
this._minIntegerDigits=1;
this._groupingUsed=true;
}
TrNumberFormat.getNumberInstance=function(a2)
{
return new TrNumberFormat("number",a2);
}
TrNumberFormat.getCurrencyInstance=function(a3)
{
return new TrNumberFormat("currency",a3);
}
TrNumberFormat.getPercentInstance=function(a4)
{
return new TrNumberFormat("percent",a4);
}
TrNumberFormat.prototype.setGroupingUsed=function(a5)
{
this._groupingUsed=a5;
}
TrNumberFormat.prototype.isGroupingUsed=function()
{
return this._groupingUsed;
}
TrNumberFormat.prototype.setMaximumIntegerDigits=function(a6)
{
if(a6)
{
this._maxIntegerDigits=a6<0?0:a6;
if(this._minIntegerDigits>this._maxIntegerDigits)
{
this._minIntegerDigits=this._maxIntegerDigits;
}
}
}
TrNumberFormat.prototype.getMaximumIntegerDigits=function()
{
return this._maxIntegerDigits;
}
TrNumberFormat.prototype.setMaximumFractionDigits=function(a7)
{
if(a7)
{
this._maxFractionDigits=a7<0?0:a7;
if(this._maxFractionDigitsthis._maxIntegerDigits)
{
this._maxIntegerDigits=this._minIntegerDigits;
}
}
}
TrNumberFormat.prototype.getMinimumIntegerDigits=function()
{
return this._minIntegerDigits;
}
TrNumberFormat.prototype.setMinimumFractionDigits=function(a9)
{
if(a9)
{
this._minFractionDigits=a9<0?0:a9;
if(this._maxFractionDigits='1'&&ch<='9')||ch=='.')
break;
if(ch=='0'&&a44+1a66)
{
a68=a65-a66;
a64=a64.substring(a68,a65);
}
else if(a650)
{
a69="0"+a69;
--a68;
}
a64=a69+a64;
}
if(this.isGroupingUsed())
{
a64=this._addGroupingSeparators(a64);
}
return a64;
}
TrNumberFormat.prototype._formatFractions=function(a70)
{
var a71=a70.length;
var a72=this.getMaximumFractionDigits();
var a73=this.getMinimumFractionDigits();
if(a71>a72&&a72>=a73)
{
a70=a70.substring(0,a72);
}
if(a710)
{
a70=a70+"0";
--a74;
}
}
return a70;
}
TrNumberFormat.prototype._addGroupingSeparators=function(a75)
{
var a76=a75.length;
var a77=a76%3;
var a78;
var a79;
var a80="";
var a81=this._localeSymbols.getGroupingSeparator();
if(a77>0)
{
a78=(a76<4)?a75.substring(0,a77):a75.substring(0,a77)+a81;
a79=a75.substring(a77,a76);
}
else
{
a78="";
a79=a75;
}
for(i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy