Repository navigation
SI-prefixed display for Statistics panel and chart y-axis - #9
Merged
Merged
Conversation
Statistics panel entries (Average/Min/Max/Peak-to-Peak/Std Dev) and the
realtime chart's y-axis now render with SI unit prefixes (e.g. "11.13 MΩ")
instead of raw base-unit numbers (e.g. "11130000.00 Ω"). Display only —
no change to stored values, resolution, CSV export, or Data Log rows.
- Each Statistics panel entry picks its own SI prefix from its own
magnitude; the chart's y-axis picks one shared prefix per redraw from
the visible range (lib/si.ts: siPrefixOf, formatSiValue).
- Decimals come from the existing measurement-resolution tracking
(binWidth/recordedResolution), never a new precision source.
- The SI prefix is chosen from a value's true, unrounded magnitude and
never re-picked after rounding, so a value can't be promoted into the
next prefix by rounding (999999.6 Ω at 1 Ω resolution reads
"1000.000 kΩ", never "1.00 MΩ").
- Capacitance's internal base unit is nF, not physical F — corrected via
toPhysicalUnit wherever a capacitance number reaches the formatter.
- siPrefixOf relocated from lib/passfail.ts to a new lib/si.ts, now
shared by the Dashboard, Pass/Fail, and the chart.
Hardware-tested against a ZOYI ZT703s (28/29 cases passing on first run);
three real issues found and fixed:
- A genuine zero (e.g. Peak-to-Peak before a 2nd sample) briefly rendered
as a long decimal string ("0.00000000000000F") instead of "0".
- Pass/Fail's Measured Spread panel showed a flat 3 decimals against the
meter's real resolution once SI-scaled next to the Dashboard's
resolution-accurate numbers. VerdictRow now carries the capturing
reading's resolution; Pass/Fail tracks the coarsest resolution across
the batch's captured rows, same as the Dashboard.
- Clear Batch could re-trigger a capture (and verdict beep) for a part
still sitting on the probes, from any view, because it redundantly
reset the same-part capture guard that already re-arms correctly on a
genuine probe lift.
Three unrelated findings from the same test pass (unbounded manual
y-range inputs, unscaled histogram bin labels, a bad x-axis offset after
reload-before-reconnect) are recorded as known issues, not fixed here.
🤖 Generated with [Claude Code](https://claude.ai/code)
Fyfar
force-pushed
the
feat/si-unit-display
branch
from
September 28, 2026 12:40
19c9f67 to
3b95c0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Statistics panel entries (Average/Min/Max/Peak-to-Peak/Std Dev) and the realtime chart's y-axis now render with SI unit prefixes (e.g.
11.13 MΩ) instead of raw base-unit numbers (e.g.11130000.00 Ω). Display only — no change to stored values, resolution, CSV export, or Data Log rows.lib/si.ts:siPrefixOf,formatSiValue).binWidth/recordedResolution), never a new precision source.999999.6 Ωat1 Ωresolution reads1000.000 kΩ, never1.00 MΩ).nF, not physicalF— corrected viatoPhysicalUnitwherever a capacitance number reaches the formatter.siPrefixOfrelocated fromlib/passfail.tsto a newlib/si.ts, now shared by the Dashboard, Pass/Fail, and the chart.Hardware testing
Tested against a ZOYI ZT703s (28/29 cases passing on first run); three real issues found and fixed:
0.00000000000000F) instead of0.VerdictRownow carries the capturing reading's resolution; Pass/Fail tracks the coarsest resolution across the batch's captured rows, same as the Dashboard.Three unrelated findings from the same test pass (unbounded manual y-range inputs, unscaled histogram bin labels, a bad x-axis offset after reload-before-reconnect) are recorded as known issues, not fixed here.
Verification
npx tsc --noEmit— cleannpx eslint— cleannpm run check— all 8 self-checks pass, including newcheck-si.mts(19/19)npm run build— production build succeedsVersion bumped
1.7.2→1.8.0(minor, non-breaking addition).🤖 Generated with Claude Code