JavaScript真正的四舍五入的方法

/*真正的四舍五入的方法
Dight:要计算的数
How:要保留的位数
*/
function ForDight(Dight, How) {
    Dight = Math.round(Dight * Math.pow(10, How)) / Math.pow(10, How);
    return Dight;
}

==========================================================

posted @ 2013-10-31 14:49  xinhua_wen  阅读(153)  评论(0编辑  收藏  举报