function myfun(src,pos){
return Math.round(src*Math.pow(10,pos))/Math.pow(10,pos);
}
alert(myfun(4.15,1));
alert(myfun(4.015,2));
alert(myfun(4.01559267,3));
alert(4.15.toFixed(1));
alert(4.015.toFixed(2));
alert(4.01559267.toFixed(3));
在IE下第二个alert为什么谈的值没有做到四舍五入????而下面的toFixed方法正确
在FireFOX第二个和倒数第二个均没有四舍五入?
求解!!!!!!