function isPositiveInteger(s)
{
	var i;
	if ((s == null) || (s.length == 0)) 
		return false;
	
	// Search through string's characters one by one
	// until we find a non-numeric character.
	// When we do, return false; if we don't, return true.
	for (i = 0; i < s.length; i++)
	{   
	    // Check that current character is number.
	    var c = s.charAt(i);
	    if (!(c >= "0" && c <= "9"))
	    	return false;
	}
	// All characters are numbers.
	return true;
}

function roundOff(value, precision)
{
	value = "" + value; //convert value to string
	precision = parseInt(precision);
	var whole = "" + Math.round(value * Math.pow(10, precision));
	var decPoint = whole.length - precision;
	if(decPoint != 0)
	{            
		result = whole.substring(0, decPoint);
		result += ".";
		result += whole.substring(decPoint, whole.length);        
	} else {
		result = whole;
	}
	return result;
}
