Custom software / calculation acceptance
Why can two software totals differ by one cent?
Two systems can start with the same values yet produce different totals when they round at different steps. Before accepting a calculation, agree its inputs, precision, rounding method and the point where rounding happens.
This is a fictional software acceptance exercise, not tax, accounting or legal advice. It does not prescribe a business's required calculation policy or describe a delivered Flextech feature.
1. Compare rounding each line with rounding the total
Imagine three independent calculation lines, each with an exact unrounded amount of 0.335 units. For this example only, choose two decimal places and round a halfway value away from zero.
Round each line, then add: 0.34 + 0.34 + 0.34 = 1.02.
Add first, then round once: 0.335 + 0.335 + 0.335 = 1.005, rounded to 1.01.
The difference is 0.01. Neither result establishes which calculation the business is required to use. The owner must specify the policy, including whether displayed line amounts must add to the displayed total and how any permitted reconciliation is explained. Do not silently alter a line to make the screen look consistent.
2. “Two decimal places” does not fully define the rule
In this separate fictional test, the exact input 1.005 is halfway between 1.00 and 1.01. Rounding to the nearest even last retained digit gives 1.00; rounding a halfway value away from zero gives 1.01. For -1.005, those results are -1.00 and -1.01 respectively. Include negative adjustments in the specification instead of testing only positive values.
Microsoft's MidpointRounding documentation distinguishes these strategies and also describes directed rounding. This is a programming reference, not a recommendation for an organization's financial policy. State the required strategy rather than relying on a method's default.
3. Keep calculation precision separate from display formatting
A screen showing 1.01 does not tell a reviewer what was stored or passed to the next calculation. Specify the precision of imported inputs, intermediate values, stored results and displayed output separately. Ask whether a downstream calculation uses the full value or the already-rounded value.
For an interface between two systems, agree which side owns the calculation and what a disagreement should show. Include the raw fictional inputs and the expected intermediate values in the API integration scope; comparing only two screenshots of a final total can hide the cause.
4. Turn the rule into a small acceptance fixture
- Ordinary values: include a case with no halfway value so the baseline calculation is easy to inspect.
- Exact halfway values: use the 1.005 example and state the chosen result explicitly.
- Negative adjustments: test -1.005 under the same named strategy and confirm how it combines with a positive amount.
- Multiple lines: run the three-line example above under the chosen order of operations.
- Input and export: verify that an imported decimal and the exported result preserve the agreed precision, rather than relying on what a spreadsheet happens to display.
- Changed calculation: decide how an authorized rule change is versioned and whether old results remain as originally produced or are recalculated. Label a recalculation rather than quietly replacing an approved result.
Run these checks using invented data in an approved test environment. Keep the input strings, calculation order, rounding mode, expected intermediate values, expected final value and actual result. This guide's worked examples were checked with decimal arithmetic, not against a customer's system or a production .NET application.
Bring the rule, not only the disputed total
For a scope discussion, identify the calculation's business owner, show a fictional mismatch and state what remains undecided. Flextech can discuss the software behavior once the applicable calculation requirements and safe test path are clear.
Discuss a calculation workflow ↗