AI Anonymous / Practical field guide / November 15, 2026

Round when?

Three AI jobs each use 0.005 credit. A fictional usage dashboard shows 0.03, while the batch report shows 0.02. Find the step that changes the total.

In this field note · 6 sections
  1. Compare both totals
  2. Find the rounding step
  3. Make it your own
  4. Specify what your report totals
  5. Read the Python references
  6. Get the practice and posting files

Imagine an assistant drafts two views from the same usage export. One adds the values displayed on each row. The other adds the raw measurements and rounds the sum. Both use the same tie rule. The difference is when they apply it.

What we ran. An offline lab on Windows with Python 3.13.15, a three-job JSON fixture, and an adapted fourth job. It uses the Python standard library.
AI Anonymous poster reading “Round when?” Three loose brass tokens and a stack sit on ledger paper beside a brass balance scale and pencil. JABSystems.io appears below.
Original AI-generated artwork of a brass balance scale and tokens on a ledger.

01 / Reproduce

Compare both totals

Extract the practice ZIP to a fresh folder. Open PowerShell in that folder and run the script. The three jobs in usage.json are fictional and each reports 0.005 credit.

python .\compare-rounding.py
Raw total           0.015
Sum of rounded jobs 0.03
Rounded batch total 0.02

The row approach rounds each 0.005 to 0.01, then adds the three. The batch approach adds them to get 0.015, then rounds once to 0.02. In both paths, ties round away from zero.

02 / Inspect

Find the rounding step

The script reads JSON decimal fractions with parse_float=Decimal, so 0.005 goes directly from its JSON text into a decimal value. The explicit rounding argument gives both calculations the same tie rule. Decimal("0.01") sets the result to two decimal places.

from decimal import Decimal, ROUND_HALF_UP

step = Decimal("0.01")
credits = [Decimal("0.005")] * 3
rounded_jobs = sum(n.quantize(step, rounding=ROUND_HALF_UP) for n in credits)
rounded_batch = sum(credits).quantize(step, rounding=ROUND_HALF_UP)
print(rounded_jobs, rounded_batch)

The snippet prints 0.03 0.02. Each line calls the same rounding method. In the first line the method runs inside the sum. In the second it runs after the sum.

03 / Make it your own

Add one more job

Open usage.json, add a comma after the third object, and append the object below inside the square brackets. Run the same script again.

{"job": "J-104", "credits": 0.005}

The raw total is now 0.020. The sum of rounded rows rises to 0.04, while the rounded batch total stays 0.02. Save this fixture as a regression case if your report promises a batch total. Assert that the report shows 0.02 and label the per-job values as rounded for display.

Boundaries

Specify what your report totals

Write the rounding stage and tie rule into the report specification. If you use AI to draft the implementation, try this instruction.

Sum the raw decimal credits before rounding the batch total to two places. Use half-up rounding. Label the individual displayed values as rounded.

The script assumes a reviewed fixture with small, finite numeric credits that fit within the decimal context’s precision. Validate the shape and numeric bounds of any external input before using this pattern. The exercise verified local arithmetic on authored data. The suggested prompt, model behavior, provider billing, and performance were outside the exercise.

Primary sources / Checked November 15, 2026

Read the Python references

Downloads / Practice and social files

Get the practice and posting files

Explore more AI Anonymous field notes →

Share this post.

Found this useful? Pass it along. Download the artwork, add your own take, and tag @jabsystems.io so I can see your post.