Skip to main content
Version: 1.2.0

Ceil

Arithmetic Data Analysis

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:

FieldRequiredDefaultDescription
fieldY-Target field to store the ceiling result
valueY-Source value or field reference to round up
descriptionN-Explanatory note
ifN-Condition to run
ignore_failureNfalseContinue processing if calculation fails
ignore_missingNfalseSkip processing if referenced field doesn't exist
on_failureN-See Handling Failures
on_successN-See Handling Success
tagN-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.

note

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.

warning

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...

{
"price": 24.32
}
- ceil:
field: price_rounded
value: "{{price}}"

creates a new field with rounded-up value:

{
"price": 24.32,
"price_rounded": 25
}

In-Place Rounding

Replacing field value with its ceiling value...

{
"value": 3.14
}
- ceil:
field: value
value: "{{value}}"

overwrites the original value:

{
"value": 4
}

Using Numeric Literals

Calculating ceiling from a literal...

{
"data": {}
}
- ceil:
field: rounded_value
value: "9.999"

sets field to the ceiling value:

{
"data": {},
"rounded_value": 10
}

Handling Whole Numbers

Applying ceiling to a whole number...

{
"quantity": 42
}
- ceil:
field: quantity_ceiling
value: "{{quantity}}"

returns the same number (as it's already an integer):

{
"quantity": 42,
"quantity_ceiling": 42
}

Conditional Processing

Applying ceiling only when needed...

{
"metric": 98.6,
"needs_rounding": true
}
- ceil:
field: metric_rounded
value: "{{metric}}"
if: "logEntry.needs_rounding == true"

processes conditionally:

{
"metric": 98.6,
"needs_rounding": true,
"metric_rounded": 99
}