Ceil
Synopsis
Rounds a number up to the nearest integer.
Schema
- ceil:
field: <ident>
value: <string>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
The following fields are used to define the processor:
Field | Required | Default | Description |
---|---|---|---|
field | Y | - | Target field to store the ceiling result |
value | Y | - | Source value or field reference to round up |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if calculation fails |
ignore_missing | N | false | Skip processing if referenced field doesn't exist |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
Rounds a floating-point number up to the nearest integer (ceiling function) and stores the result in the specified field. The processor takes a numeric value, applies the mathematical ceiling operation, and returns the smallest integer greater than or equal to the input.
The processor will automatically convert string representations of numbers to their numeric values before applying the ceiling function. For negative numbers, the ceiling function will return the closest integer toward positive infinity (e.g., ceil(-4.3) = -4).
The processor can evaluate numeric values from a field reference or a numeric literal. The result is always an integer value, represented as a float with no decimal portion.
If the specified value or referenced field cannot be converted to a number, the processor will fail unless ignore_failure
is set to true
. Always ensure that the input value is numeric or can be parsed as a number.
Examples
Basic Ceiling Operation
Rounding up a decimal value... |
|
creates a new field with rounded-up value: |
|
In-Place Rounding
Replacing field value with its ceiling value... |
|
overwrites the original value: |
|
Using Numeric Literals
Calculating ceiling from a literal... |
|
sets field to the ceiling value: |
|
Handling Whole Numbers
Applying ceiling to a whole number... |
|
returns the same number (as it's already an integer): |
|
Conditional Processing
Applying ceiling only when needed... |
|
processes conditionally: |
|