js 数值格式化函数

function ForDight(Dight,How){
 
var Dight = Math.round (Dight*Math.pow(10,How))/Math.pow(10,How); 
 
return Dight; 
 
} 
//ForDight(Dight,How):数值格式化函数;
//Dight:要格式化的 数字;
//How::要保留的小数位数。 

 

posted @ 2016-07-06 14:20  李元伟丶  阅读(1038)  评论(0编辑  收藏  举报