calculate_percentage
Calculate the value of a percentage of a total, the percentage change between two values, or what percent one value is of another.
Instructions
Perform one of three percentage operations selected by operation: the value of a percent of a total, the percentage change between two values, or what percent one value is of another. Inputs: operation (see enum), a and b (the two operands — their meaning depends on the operation, as described in the parameter docs). Returns the numeric result with the applied formula. Read-only and deterministic.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | First value | |
| b | Yes | Second value | |
| operation | Yes | of: X% of Y; change: from A to B; what_pct: X is what % of Y |