function rnd(val, prec)
{
	if(rnd.arguments.length==1)
		prec=0;
	val = val * Math.pow(10,prec);
	val = Math.round(val);
	val = val / Math.pow(10,prec);
	return val;
}