向上取整
Math.ceil()
向下取整
Math.floor()
四舍五入
Math.round()
四舍五入(自定义取小数后几位)
// 计算结果是字符串
(5.6666666).toFixed(4)
向上取整
Math.ceil()
向下取整
Math.floor()
四舍五入
Math.round()
四舍五入(自定义取小数后几位)
// 计算结果是字符串
(5.6666666).toFixed(4)