Skip to main content

Ceil

This node rounds a number up to the nearest integer.

The Ceil node performs the ceiling mathematical function.

The Ceil node takes a numeric input and rounds it up to the next largest integer. For example, 4.1 becomes 5, and -4.1 becomes -4. It includes validation to ensure the input is a valid number within safe limits.

Inputs

Input

DataDescription
ValueThe number to round up. Default: 0.

Actions

SignalDescription
DoTriggers the calculation. The result is updated only when this signal is received.

Outputs

Data

DataDescription
Ceiling ValueThe rounded integer result.

Signals

SignalDescription
DoneTriggered when the calculation is successfully completed.

Usage

Use this node when you need to ensure a value is an integer and always rounded up, such as calculating the number of containers needed for a set of items.

Example Use Cases

  1. Pagination: Calculating total pages.
    • Total Items / Items Per Page = 4.2 pages.
    • Ceil(4.2) = 5 pages needed.
  2. Grid Layout: Determining rows needed.
    • Total Elements / Columns = Rows.
    • Ceil ensures you have enough rows for the overflow.
  3. Pricing: Rounding up to the nearest dollar.

Detailed Behavior

  1. Validation:
    • Input must be a valid number.
    • Input and Result must be within ±1,000,000,000,000.
  2. Calculation:
    • Uses Math.ceil().
    • Triggered only by the Do signal.
  3. Error Handling:
    • If the result exceeds the allowed range, an error is logged and Done is not signaled.

Troubleshooting

  • No Output: Check if the input is a valid number. Ensure you are triggering the Do signal.