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
| Data | Description |
|---|---|
| Value | The number to round up. Default: 0. |
Actions
| Signal | Description |
|---|---|
| Do | Triggers the calculation. The result is updated only when this signal is received. |
Outputs
Data
| Data | Description |
|---|---|
| Ceiling Value | The rounded integer result. |
Signals
| Signal | Description |
|---|---|
| Done | Triggered 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
- Pagination: Calculating total pages.
Total Items/Items Per Page=4.2pages.- Ceil(
4.2) =5pages needed.
- Grid Layout: Determining rows needed.
Total Elements/Columns=Rows.- Ceil ensures you have enough rows for the overflow.
- Pricing: Rounding up to the nearest dollar.
Detailed Behavior
- Validation:
- Input must be a valid number.
- Input and Result must be within ±1,000,000,000,000.
- Calculation:
- Uses
Math.ceil(). - Triggered only by the
Dosignal.
- Uses
- Error Handling:
- If the result exceeds the allowed range, an error is logged and
Doneis not signaled.
- If the result exceeds the allowed range, an error is logged and
Troubleshooting
- No Output: Check if the input is a valid number. Ensure you are triggering the
Dosignal.