天天看點

java截取一位小數 js截取一位小數

//js截取一位小數
function fomatFloat(src,pos){ 
	return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos);      
	}