Lodash教程

Lodash ceil method

语法

Computes number rounded up to precision.
Creates a function that invokes func, with the this binding and arguments of the created function, while it's called less than n times. Subsequent calls to the created function return the result of the last func invocation.

参数

number (number) − The number to round up. [precision=0] (number) − The precision to round up to.

输出

(number) − Returns the rounded up number.

实例

var _ = require('lodash');
 
console.log(_.ceil(5.004));
console.log(_.ceil(5.004,2));
Save the above program in tester.js. Run the following command to execute this program.

Command

\>node tester.js

输出

6
5.01
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4