﻿

function NumberFormatInfo(decimalDigits, decimalSeparator, groupSeparator, groupsize, negPattern, posPattern)
{
    this.DecimalDigits = decimalDigits;
    this.DecimalSeparator = decimalSeparator;
    this.GroupSeparator = groupSeparator;
    this.GroupSize = groupsize;
    this.NegativePattern = negPattern;
    this.PositivePattern = posPattern;
}

NumberFormatInfo.prototype.FormatNumber=function(_9)
{
	var _a=Math.abs(_9).toFixed(this.DecimalDigits).split(".");
	var _b=_a[0].split("");
	var _c=_a[1];
	var _d=[];
	var _e=0;
	while(_b.length>0)
	{
		if(this.GroupSize>0)
		{
			if(_e===this.GroupSize)
			{
				_d.push(this.GroupSeparator);
			}
			_e%=this.GroupSize;
		}
		_d.push(_b.pop());
		_e++;
	}
	var _f=_d.reverse().join("");
	if(_c)
	{
		_f+=(this.DecimalSeparator+_c);
	}
	return (_9<0)?this.NegativePattern.replace("n",_f):this.PositivePattern.replace("n",_f);
};

