function ForDight(Dight,How)
Dight = Math.round(Dight*Math.pow(10,How))/Math.pow(10,How);
return Dight;
}
Dight : 要进行四舍五入的数
How : 要舍入的位数
四舍五入函数实现
本文介绍了一个简单的四舍五入函数实现方法,该函数可以根据指定的位数对输入的数值进行精确的四舍五入处理。
function ForDight(Dight,How)
Dight = Math.round(Dight*Math.pow(10,How))/Math.pow(10,How);
return Dight;
}

被折叠的 条评论
为什么被折叠?