# Calculator

> Perform deterministic arithmetic, percent-based math, and change-rate math.

- Skill: `zgiai/calculator` (Agent Skill)
- Install (CLI): `npx skillmds@latest add zgiai/calculator`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zgiai/calculator/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: zgiai (https://skillmd.com/u/zgiai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zgiai/calculator

---


# Calculator Skill

Use this skill for exact arithmetic and percentage tasks.

## Workflow

1. Prefer one `call_skill_tool` call with `tool_name` set to `evaluate_expression` when the task can be represented as one arithmetic expression.
2. For totals followed by discounts, markups, taxes, or fixed reductions, fold the full final arithmetic into one expression whenever the condition is clear from the problem statement.
3. If a condition must be verified numerically first, use at most two expression calls: one for the condition value and one for the final result.
4. Use `calculate` only when a single binary operation is clearer than a full expression.
5. Use `percentage` only when the user asks specifically for percent-of, percentage change, or applying a percentage increase/decrease and a single expression would be less clear.
6. Before calling `evaluate_expression`, convert the calculation into a pure numeric expression with ASCII operators. Remove units, natural-language notes, labels, thousands separators, and non-standard operators such as `×` or `÷`.
7. Do not calculate mentally when the user expects an exact result.
8. In the final answer, include a concise summary of the calculation process and the result.
9. Mention rounding when a precision value affects the displayed result.

## Tool Usage

`evaluate_expression` accepts:

- `expression`: a restricted arithmetic expression using numbers, parentheses, `+`, `-`, `*`, `/`, `%`, and `^`.
- `precision`: optional decimal places from 0 to 12.

Use decimal percentages inside expressions. For example, use `0.85` for an 85 percent multiplier and `0.15` for a 15 percent decrease.

Example for a grocery total with a fixed reduction and member discount:

- `expression`: `(9.5*10 + 4.8*15 + 15*5 - 30) * 0.85`
- `precision`: `2`

`calculate` accepts:

- `operation`: `add`, `subtract`, `multiply`, `divide`, `power`, or `mod`.
- `left`: left operand.
- `right`: right operand.
- `precision`: optional decimal places from 0 to 12.

`percentage` accepts:

- `operation`: `percent_of`, `change`, `apply_increase`, or `apply_decrease`.
- `value`: base value for `percent_of`, `apply_increase`, and `apply_decrease`.
- `percent`: percentage value, for example `15` means 15 percent.
- `from`: original value for `change`.
- `to`: new value for `change`.
- `precision`: optional decimal places from 0 to 12.

