feat: Add a percentage function to the calculator #18

Merged
typosaurus merged 2 commits from typosaurus/16-add-a-percentage-function-to-the-calculator into main 2026-07-26 21:51:01 +02:00
Owner

What was built

Add a percentage(value, total) function to the calculator returning value as a percentage of total, raising ValueError when total is zero. Follow the house rules.

Acceptance criteria

  • The ticket objective is satisfied: Add a percentage function to the calculator

Commits

Commit Summary Node
c6ff93c764a8 test(sveta): Write tests for percentage function 7edce3239d43
e11ca4b3761c feat(nadia): Implement percentage function in calculator.py baf308443217

Run

Cost: 0.0025 USD · Nodes: 7 · Verification: make verify

Closes #16

## What was built Add a `percentage(value, total)` function to the calculator returning value as a percentage of total, raising ValueError when total is zero. Follow the house rules. ## Acceptance criteria - The ticket objective is satisfied: Add a percentage function to the calculator ## Commits | Commit | Summary | Node | |---|---|---| | `c6ff93c764a8` | test(sveta): Write tests for percentage function | `7edce3239d43` | | `e11ca4b3761c` | feat(nadia): Implement percentage function in calculator.py | `baf308443217` | ## Run Cost: 0.0025 USD · Nodes: 7 · Verification: make verify Closes #16
typosaurus added 2 commits 2026-07-26 19:01:37 +02:00
Outcome: done
Changed: src/calculator.py:1 (import Union), src/calculator.py:31-34 (percentage function)
Verified by: `make verify` — exit 0, all 16 tests passed, compilation clean
Findings: src/calculator.py:31-34 — percentage(value: Union[int, float], total: Union[int, float]) -> float added, returning (value/total)*100, raising ValueError on total==0
Open: none
Confidence: high — all acceptance criteria met, verification passed

Typosaurus-Run: ff52a86851934fd293e2f4493c5a9a46
Typosaurus-Node: baf30844321745fb8a1aabe91a33823b
Typosaurus-Agent: @nadia
Refs: #16
Outcome: done
Changed: tests/test_calculator.py:1 (import), tests/test_calculator.py:66-96 (new TestPercentageFunction class)
Verified by: `make verify` — exit 0, Ran 23 tests, OK
Findings: tests/test_calculator.py:66-96 — TestPercentageFunction class added with 7 test methods (valid_percentage, zero_value, full_value, fractional, total_zero, float_arguments, negative_value). All 23 tests pass.
Open: none
Confidence: high — all acceptance criteria met, verification passed

Typosaurus-Run: ff52a86851934fd293e2f4493c5a9a46
Typosaurus-Node: 7edce3239d434d36aed06535aae0d0ad
Typosaurus-Agent: @sveta
Refs: #16
typosaurus merged commit 2ee246fad6 into main 2026-07-26 21:51:01 +02:00
typosaurus deleted branch typosaurus/16-add-a-percentage-function-to-the-calculator 2026-07-26 21:51:49 +02:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: typosaurus/typosaurus-sandbox#18
No description provided.