ITeye博客

JS四舍五入

java.zhangshuling · 2015-01-23 08:27 · javascript · 编程语言 · Markdown


//四舍五入
function roundNumber(number,fractionDigits){  
  with(Math){  
    return round(number*pow(10,fractionDigits))/pow(10,fractionDigits);  
  }  
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。