// 对 num 保留三位小数 var accuracy = Math.pow(10,3) Math.round(num * accuracy) / accuracy
Math.toFixed()并不是四舍五入
Math.round(1.2465 * 1000) / 1000
1.247
Math.round(1.2464 * 1000) / 1000
1.246
// 对 num 保留三位小数 var accuracy = Math.pow(10,3) Math.round(num * accuracy) / accuracy
Math.toFixed()并不是四舍五入
Math.round(1.2465 * 1000) / 1000
1.247
Math.round(1.2464 * 1000) / 1000
1.246