`
sbiigu
  • 浏览: 160047 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

js 保留两位小数

阅读更多
function fomatFloat(src,pos){
		 return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos);
	}
分享到:
评论
1 楼 ly250616150 2011-11-03  
function fomatFloat(src,pos){  
         return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos);  
    } 

相关推荐

Global site tag (gtag.js) - Google Analytics