js小数点后保留几位方法:toFixed

 

(0.22223343534).toFixed(2)
结果:0.22

 

posted @ 2015-08-11 17:41  sunhaikuo  阅读(205)  评论(0编辑  收藏  举报