/*
* Format number object.
* Contains functions for formatting numbers
*/

function Format() {}

/*
* Remove commas from a number string.
*/
Format.prototype.removeComma = function(number)
{
    return number.replace(/\,/g,'');
}

/*
* Add commas to a number string.
*/

Format.prototype.addComma = function(nStr)
{
   	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

/*
* Round a number up/down
*/

Format.prototype.round = function(number)
{
	return Math.round(number);
}

	
