lodash round

_.round(number, [precision=0])

根据 precision 四舍五入 number。

_.round(4.006);
// => 4

_.round(4.006, 2);
// => 4.01

_.round(4060, -2);
// => 4100

猜你喜欢

转载自www.cnblogs.com/mengfangui/p/9210410.html
今日推荐