首页 > 技术文章 > js 保留两位小数 javascript
mayufo 2015-04-11 18:31 原文
alert((0.9996*100).toFixed(2));
得到99.96,这是我想要的! 使用Number.toFixed()可以格式数字显示任意的小数位!