js保留小数 js保留2位小数方法

338 阅读1分钟

toFixed()方法 

var num = 55;  
num.toFixed(2); 

结果:55.00