Number
Number operations for arithmetic, formatting, validation, and helpers.
Type
data-ops.number Block Data Operations
Folder
basic/data-opsChannels
Any
Pipe
Value
Scope
Any
Number (canvas label Number · plus the operation) runs one numeric Operation and writes the result to the data pipe. Invalid numbers (divide by zero, empty list for average, and similar) fail the block.
For a single formula such as (2 + 3) * 5, Evaluate Math is often enough. Use this block for rounding, currency, random integers, and list statistics.
Configure
| Setting | Description |
|---|---|
| Operation | Grouped list. Changing it resets the other fields |
| Remaining fields | Depend on Operation (for example A, B, Number, Array) |
Handles
| Handle | Role |
|---|---|
| In (target) | Incoming connection |
| Out (source) | Continues after the operation |
Pipe schema
The next block reads this on the data pipe (pipe.value). The type depends on Operation: number, true/false, or text (conversion and formatting).
Operations
Core
| Operation | Result | Inputs |
|---|---|---|
| Create | number | Value — convert to number |
| Is valid | true/false | Value — converts and is not NaN |
| Is finite | true/false | Number |
Arithmetic
| Operation | Result | Inputs |
|---|---|---|
| Add / Subtract / Multiply / Divide / Mod | number | A, B — divide and mod fail when B is 0 |
| Power | number | Base, Exponent |
Rounding
| Operation | Result | Inputs |
|---|---|---|
| Round / Floor / Ceil / Trunc | number | Number |
| Round to decimals | number | Number, Decimals (integer 0–100) |
Comparison and range
| Operation | Result | Inputs |
|---|---|---|
| Equals / Greater than / Greater or equal / Less than / Less or equal | true/false | A, B |
| Min / Max | number | Numbers (list, at least one) |
| Clamp | number | Number, Min, Max |
| In range | true/false | Number, Min, Max — inclusive |
Math helpers and random
| Operation | Result | Inputs |
|---|---|---|
| Abs / Sqrt / Cbrt / Log / Log10 / Exp | number | Number — sqrt needs ≥ 0; log needs > 0 |
| Random | number | None — in [0, 1) |
| Random int | number | Min, Max — inclusive integers |
Conversion and formatting
| Operation | Result | Inputs |
|---|---|---|
| To string | text | Number |
| To fixed | text | Number, Digits |
| To precision | text | Number, Precision |
| Format | text | Number, optional Locale, optional Intl options |
| Currency | text | Number, Currency code (3-letter ISO, for example USD), optional Locale |
| Percentage | text | Number, optional Decimals — value 0.5 becomes 50.00% |
Validation
Each takes Number and returns true/false: Is integer, Is float, Is even, Is odd, Is positive, Is negative.
List stats and interpolation
| Operation | Result | Inputs |
|---|---|---|
| Sum / Average / Median | number | Array of numbers |
| Percentile | number | Array, Percentile (0-100) |
| Normalize | number | Number, Min, Max — scale to 0–1 |
| Lerp | number | A, B, T (0-1) — linear interpolation |
Constants
No extra fields. Result is a number: PI, E, MAX_SAFE, MIN_SAFE.
Use case
- Multiply quantity × price, then Currency for a message.
- Round to decimals before writing a table number field.
- Sum a list of amounts from Table Find.