> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/math/ceil.md).

# \_.ceil（向上舍入）

**语法：**

```javascript
_.ceil(number, [precision=0])
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L16211)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.ceil)

**描述：**

根据`precision`（精度） 向上舍入`number`。

> `precision`（精度）可以理解为保留几位小数。

**开始版本：**&#x33;.10.0

**参数：**

* `number (number)`: 要向上舍入的值。
* `[precision=0] (number)`: 向上舍入的的精度。

**返回值：**

* `(number)`: 返回向上舍入的值。

**例子：**

```javascript
_.ceil(4.006);
// => 5

_.ceil(6.004, 2);
// => 6.01

_.ceil(6040, -2);
// => 6100
```
