Number Operations
Last updated
Last updated
The Number Operations building block allows you to perform various mathematical and formatting operations on numbers. If the value to apply the operation on is empty, the TaskBot will take no action and continue its run.
Combine two numbers or concatenate two strings.
Examples
1 + 1 ⟶ 2
"hello" + " world" ⟶ "hello world"
Use Case Example
Add a counter to limit number of actions per TaskBot run. See example set-up:
Subtract one number from another.
Example: 5 - 3 ⟶ 2
Multiply two numbers.
Example: 4 * 3
⟶ 12
See a use case example here: Example: Standardize different formats
Divide one number by another.
Example: 10 / 2 ⟶ 5
Round a number to the nearest whole number.
Example: 2.6 ⟶ 3
Round a number up to the nearest whole number.
Example: 2.2 ⟶ 3
Round a number down to the nearest whole number.
Example: 2.7 ⟶ 2
Generate a random number within a specified range.
If no minimum or maximum values are provided, the TaskBot will use the default values: 0 for the minimum and 1,000,000,000 for the maximum.
Example: Minimum 1, maximum 5 ⟶ 3.45
Set the number of decimal places for a number.
Example: 2 decimals: 5 ⟶ 5.00, 5.5333 ⟶ 5.53
Remove formatting such as commas or dots in a number.
If a number is used for arithmetic calculations (+, -, /, *) or numeric comparisons (> or <), it is recommended to first convert it to a clean number for higher reliability. This is when this operation comes in handy.
Examples
1.000.000,23 is dot-grouped and will be converted to 1000000.23
1,000,000.23 is comma-grouped and will be converted to 1000000.23
1,000.000.23 has wrong format and an error report will be generated
Additional Notes
If the value to perform the operation on (e.g., value to add to, number to round up) is not provided, the operation is skipped, and the TaskBot will continue without making changes.
For operations requiring two values (e.g., add, subtract), if the value to use is not provided, the operation is skipped, and the TaskBot will continue without making changes.
If the operation requires a valid number (any operation except Add) and the input is not a number, the TaskBot will generate an error report and stop the run.