function toFixed (num, n)// 四舍五入保留n位小数
{
if (!isNaN(num)) {
var multiple = Math.pow(10, n);
return Math.round(num * multiple) / multiple;
}else{
return num
}
}
javascript四舍五入保留n位小数
猜你喜欢
转载自weibin529.iteye.com/blog/2274235
今日推荐
周排行