_.round(number, [precision=0])
Computes number
rounded to precision
.
Since
3.10.0
Arguments
number
(number): The number to round.[precision=0]
(number): The precision to round to.
Returns
(number): Returns the rounded number.
Example
_.round(4.006);// => 4_.round(4.006, 2);// => 4.01_.round(4060, -2);// => 4100
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .