主题
floor
js
_.floor(number, [precision=0])
计算 number
向下舍入到 precision
。
¥Computes number
rounded down to precision
.
新增于
¥Since
3.10.0
参数
¥Arguments
number
(数值):向下舍入的数字。¥
number
(number): The number to round down.[precision=0]
(数值):要向下舍入到的精度。¥
[precision=0]
(number): The precision to round down to.
返回
¥Returns
(数值):返回向下舍入的数字。
¥(number): Returns the rounded down number.
示例
¥Example
js
_.floor(4.006);
// => 4
_.floor(0.046, 2);
// => 0.04
_.floor(4060, -2);
// => 4000