Reference
Format number node
Please contact your Customer Success Manager to get access to this node. This is a dedicated feature that is not generally available.
What is format number?
The format number node allows you to modify numbers in various ways enabling standardisation and ease in manipulating numerical data. This node contains the following actions to select from:
- Set a specific number of decimal places
- Basic arithmetics (addition, subtraction, multiplication, division)
- Rounding up (ceiling function)
- Rounding down (floor function)
- Regular rounding
- Generate random number
This action supports the use of single numbers and arrays.
This node rounds numbers using built-in browser logic. While this works well in most cases, you may notice slight differences with decimal values ending in 5. For financial or exact calculations, consider using a dedicated tool.
Usage scenarios
The format number node can be used for various numerical applications, this example will focus on the round to decimal point function. A business needs to ensure that all prices in an invoice are consistently displayed with two decimal places for clarity (e.g., $12.50 instead of $12.500). Using the Format Number action, they can automatically set the decimal place to two for all pricing data in the system to ensure consistency across all invoices.
Configuration of the Actions
Function | Description | Example Input | Example Output |
Set a number of decimal places | Adjusts all numbers in an array to a fixed number of decimal places. | Set to 2 decimal places:[5.1110, 10.123, 15.1] |
[5.11, 10.12, 15.10] |
Add by | Increases every number in an array by a specified value. | [10, 20, 50] , add 2 |
[12, 22, 52] |
Subtract by | Decreases every number in an array by a specified value. | [10, 20, 50] , subtract 2 |
[8, 18, 48] |
Multiply by | Multiplies every number in an array by a specified factor. | [10, 20, 50] , multiply by 2 |
[20, 40, 100] |
Divide by | Divides every number in an array by a specified value. | [10, 20, 50] , divide by 2 |
[5, 10, 25] |
Round up (ceiling function) | Rounds each number in the array up to the nearest whole number. | [1.8, 2.5, 9.7] |
[2, 3, 10] |
Round down (floor function) | Rounds each number in the array down to the nearest whole number. | [1.8, 2.5, 9.7] |
[1, 2, 9] |
Regular round | Rounds each number in the array using standard rules (≥ 0.5 up, < 0.5 down). | [1.12, 2.5, 9.7] |
[1, 3, 10] |
Generate random number (single input) | Generates a pseudorandom number between 0 and max. Set decimal place e.g. 2 |
Max: 5 |
4.46 |
Related to