Divide
AI-generatedOverview
This node performs basic arithmetic operations (addition, subtraction, multiplication, division) on two numbers provided as inputs. It is useful in scenarios where simple mathematical calculations are needed within an automation workflow, such as calculating totals, differences, or ratios dynamically. For example, it can be used to divide sales revenue by the number of transactions to find the average sale amount.
Use Case Examples
- Calculating the sum of two values from incoming data.
- Subtracting expenses from income to find profit.
- Multiplying quantity by unit price to get total cost.
- Dividing total distance by time to calculate speed.
Properties
| Name | Meaning |
|---|---|
| First Number | The first number (or dividend for division) |
| Second Number | The second number (or divisor for division) |
Output
JSON
result- The result of the arithmetic operation performed on the two input numbers
Troubleshooting
- Division by zero error: The node throws an error if the second number (divisor) is zero during division. Ensure the divisor is not zero to avoid this error.
- Unknown operation error: If an unsupported operation is selected, the node throws an error indicating the operation is unknown. Verify the operation input is one of the supported options (add, subtract, multiply, divide).
Links
- Calculator Node Documentation - Official documentation for the Calculator node in n8n, describing its usage and options.