javascript四舍五入指定精度
function round(num,pos)
{
var num = Math.round (num*Math.pow(10,pos))/Math.pow(10,pos);
return num;
}
alert(22.6734578656345+" , "+round(22.6734578656345,2)); 1 楼 ileson 2011-04-01 var a=124.45678
a.toFixed(2); 2 楼 zwllxs 2011-04-02 ileson 写道var a=124.45678
a.toFixed(2);
噢,兄弟不早说啊,害我吃力不讨好呀,呵呵