Percentage Calculator
calculate_percentageUse this when you need a percentage of a value, the percentage one value represents of another, or the base value that a part and its percentage imply. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.
Do not use this when you need the percentage change between two values (use percentage-change), a price after a percentage discount (use discount) or a tax amount (use sales-tax). What it computes: Solves the three basic percentage questions (a percentage of a number, what percentage one number is of another, and the whole behind a known part and percentage). Always returns the part, the whole and the percent. Inputs: mode (enum, optional); x (number); y (number). Complete JSON argument examples: {"mode":"percent_of","x":15,"y":240} | {"mode":"is_what_percent","x":30,"y":120} Outputs: result, sentence, part, whole, percent [%]. Formula: percent_of: result = x / 100 × y. is_what_percent: result = x / y × 100. percent_of_what: result = x / (y / 100). In every mode part = percent × whole / 100. Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/percentage with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/math/percentage.md
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | First number: the percent (percent_of) or the part (is_what_percent, percent_of_what). Percents are plain numbers, 15 means 15%. | |
| y | Yes | Second number: the whole (percent_of, is_what_percent) or the percent (percent_of_what). | |
| mode | No | Which percentage question to solve; x and y take the meaning shown in the label of the chosen mode. | percent_of |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| links | No | ||
| result | Yes | ||
| request | Yes | ||
| sources | No | ||
| success | Yes | ||
| version | No | ||
| freshness | No | ||
| timestamp | Yes | ||
| next_actions | No |