Negate
Arithmetic
Pure
Generic
Negate
Value
0
Result
Description
Pure function returning the negation of a number (i.e. -value).
When to use
Use Negate when you need to flip the sign of a number without subtracting from a specific value. It is more explicit than Subtract with a fixed minuend of zero. Both integer and decimal values are accepted. A typical use is reversing a delta or offset before feeding it into Add duration or another arithmetic node.
Pins
Input pins
| Pin | Type | Default | Notes |
|---|---|---|---|
| Value | generic(integer, decimal) | 0 | The number to negate. |
Output pins
| Pin | Type | Notes |
|---|---|---|
| Result | generic(integer, decimal) | The negated value (-value). |
Example
Convert a positive debt amount to a negative adjustment. Wire the positive debt (integer or decimal) into the Value input of Negate, then wire the Result output into the B input of Add along with the current balance in the A input. The Result output of Add is the adjusted total, which can be logged or passed downstream.