math Latest (v1.1.4)

ceil

Returns the next highest integer value by rounding up if necessary.

ceil(value: number) -> number

Description

Returns the next highest integer value by rounding up if necessary.

Arguments

Required

Name Type Description
value number

Returns

Type: number

Examples

search(ceil(1.001), null) → 2
search(ceil(1.9), null) → 2
search(ceil(1), null) → 1
search(ceil(abc), null) → ERROR: invalid-type

Given the following JSON input:


{
  "foo": -1,
  "zero": 0,
  "numbers": [
    -1,
    3,
    4,
    5
  ],
  "array": [
    -1,
    3,
    4,
    5,
    "a",
    "100"
  ],
  "strings": [
    "a",
    "b",
    "c"
  ],
  "decimals": [
    1.01,
    1.2,
    -1.5
  ],
  "str": "Str",
  "false": false,
  "empty_list": [],
  "empty_hash": {},
  "objects": {
    "foo": "bar",
    "bar": "baz"
  },
  "null_key": null
}
Expression Result
ceil(1.2) 2
ceil(decimals[0]) 2
ceil(decimals[1]) 2
ceil(decimals[2]) -1
ceil('string') ERROR: invalid-type