_.round(四舍五入)
语法:
_.round(number, [precision=0])源代码链接:source
npm包链接:npm package
描述:
根据precision(精度) 四舍五入number。
开始版本:3.10.0
参数:
number (number): 要四舍五入的数字。[precision=0] (number): 四舍五入的精度。
返回值:
(number): 返回四舍五入的数字。
例子:
_.round(4.006);
// => 4
_.round(4.006, 2);
// => 4.01
_.round(4060, -2);
// => 4100Last updated
Was this helpful?