Skip to content

fix: round calibration deltas for display - #67

Closed
Dibya0912 wants to merge 2 commits into
Nitjsefnie:mainfrom
Dibya0912:fix/calibration-delta-precision
Closed

fix: round calibration deltas for display#67
Dibya0912 wants to merge 2 commits into
Nitjsefnie:mainfrom
Dibya0912:fix/calibration-delta-precision

Conversation

@Dibya0912

Copy link
Copy Markdown

Summary

Calibration deltas such as -4/7 currently display all floating-point digits. Show at most two decimal places using the same en-US number-formatting convention as the balance card, with the original value available in the title attribute.

Related Issues and Pull Requests

Fixes #65

Changes

  • Format signed means, medians and the difference between means with at most two fractional digits.
  • Display zero when rounding would otherwise produce +0 or minus zero.
  • Preserve raw values in title attributes and add a rendering regression test.

Testing

Using the requested Node 24.17.0 and pnpm 10.33.0: both calibration test files pass (12 tests); pnpm typecheck passes; ESLint passes on both changed files. git diff --check passes.

Footer

Generated by GPT-6 (implementation, testing, review)

Copilot AI lite review requested due to automatic review settings September 5, 2026 11:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Nitjsefnie Nitjsefnie left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rounding itself is correct — it even fixes a −0 case that balance-card.tsx still gets wrong. Four things before merge:

  1. The test doesn't pin the rounding. toHaveTextContent is a substring match, so −0.5714285714285714 satisfies "−0.57". With the rounding stripped out and the titles left in, the suite still passes 3/3. Anchor lines 19–20 (/^Mean delta −0\.57$/) and add one value that rounds up, e.g. -0.999−1.

  2. title on a <p> has no touch or keyboard trigger and is read aloud in full by screen readers. A visible <span className="mono-meta"> gets you the same thing, copyable.

  3. The sign rule diverges from balance-card.tsx, which issue #65 named as the model — yours decides from the rounded string, it decides from value. Yours is better; just call it out as deliberate.

  4. d6ded91 is missing its trailer. Please amend with Co-Authored-By: GPT-6 Astra <noreply@openai.com> (space, not hyphen).

Also: comment /claim on issue #65 — the assignee is what reserves your credit for this, and nothing is assigned yet.

@Nitjsefnie

Copy link
Copy Markdown
Owner

Closing as stale and unmaintained, plus once #55 lands, your PR would be autoclosed under the rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calibration page prints mean delta at full floating-point precision

3 participants