floor:下退 Math.floor(12.9999) = 12;
ceil:上进 Math.ceil(12.1) = 13;
round: 四舍五入 Math.round(12.5) = 13; Math.round(12.4) = 12;
JS小数转为整数
最新推荐文章于 2024-04-07 14:54:14 发布
floor:下退 Math.floor(12.9999) = 12;
ceil:上进 Math.ceil(12.1) = 13;
round: 四舍五入 Math.round(12.5) = 13; Math.round(12.4) = 12;