摘要: toFixed可以做到准确的“四舍六入”,末位是5时可能会出现差错 (1.235).toFixed(2) //1.24 正确 (1.355).toFixed(2) //1.35 错误 可以使用Math.round()将数字放大一定倍数后处理 function round(number, precis 阅读全文
posted @ 2020-12-24 23:05 懒懒同学不懒 阅读(511) 评论(0) 推荐(0) 编辑