首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

js小结 数字_四舍五入

2012-08-01 
js总结 数字_四舍五入//数字 指定位数后 四舍五入function RoundNumber(num, pos){return Math.round(num

js总结 数字_四舍五入

//数字 指定位数后 四舍五入function RoundNumber(num, pos){    return Math.round(num * Math.pow(10, pos))/Math.pow(10, pos);}

热点排行