js保留两位小数的解决的方法

var a = 123.456;

a = a..toFixed(2);

alert(a);//结果:123.46

 

posted @ 2017-06-09 08:36  yangykaifa  阅读(158)  评论(0编辑  收藏  举报