Lodash floor method
语法
_.floor(number, [precision=0])
Computes number rounded down to precision.
参数
number (number) − The number to round down.
[precision=0] (number) − The precision to round down to.
输出
(number) − Returns the rounded down number.
实例
var _ = require('lodash');
console.log(_.floor(0.004));
console.log(_.floor(0.004,2));
Save the above program in
tester.js. Run the following command to execute this program.
Command
输出