Repair Money Rounding Bugs

    by Mariusz Wrzeszczynski

    1

    Repair rounding, floating-point, tax, discount, and total mismatches across existing apps.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLIVVS CodeWWindsurfMManus+14 more

    See it in action

    You say

    The total on our generated invoices is sometimes $0.01 off from the sum of the line items when discounts are applied. Can you fix the rounding logic in the billing service?

    Your agent does

    I inspected billing_service.py and found floating-point math being used for discounts. I established a Monetary Contract using integer minor units, implemented 'Half Even' rounding for line items, and added a remainder allocation check. New tests confirm subtotals now reconcile to $0.00 diff.

    What you get

    Repair floating-point errors in invoice and tax calculations.Standardize multi-currency precision and rounding modes.Reconcile application totals with payment provider requirements.Implement remainder allocation for accurate discount distribution.

    About this skill

    The problem

    Binary floating-point math and inconsistent rounding create "off-by-one-cent" errors in invoices, taxes, and refunds. These small discrepancies lead to failed audits, broken payment provider syncs, and reconciliation nightmares.

    What it does

    • Traces monetary values from input through storage, calculation, and display to find precision loss.
    • Establishes a strict Monetary Contract defining rounding modes, currency scales, and calculation stages.
    • Replaces unsafe arithmetic with integer minor units or exact decimal types.
    • Implements remainder allocation logic to ensure distributed discounts or taxes sum correctly to the total.
    • Runs automated reconciliation tests to verify that stored and displayed totals match exactly.

    Frameworks & tools

    Works with any stack using Read, Edit, and Bash tools. Specifically audits SQL schemas, ORM precision, and payment integrations like Stripe or PayPal.

    Why this beats prompting it yourself

    General LLMs often suggest simple .toFixed(2) hacks that compound rounding errors. This skill enforces a professional financial engineering workflow, distinguishing between rates, quantities, and amounts while ensuring compliance with currency-specific scales.

    Use cases

    • Fixing invoice subtotals that do not sum correctly due to line-item rounding.
    • Standardizing currency conversion logic across multi-currency databases.
    • Repairing "penny-gap" mismatches between your application and payment gateways.
    • Auditing tax calculation logic to handle inclusive and exclusive tax rules.

    Known limitations

    Will not invent tax policies or accounting rules without user evidence. Does not perform destructive migrations on production data without an audit dry-run.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Creator

    Mariusz Wrzeszczynski
    Mariusz Wrzeszczynski

    109 skills on Agensi

    Frequently Asked Questions

    Popular in Finance, Legal & Accounting