-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Extract compact numeric formatting (k/M suffix logic) into a shared formatting utility and reuse for rates/counts.
Why
format_rate and format_count each implement similar scale-threshold logic. Consolidating avoids divergence and improves formatting consistency.
Affected files
- src/ui/drawing.rs
- src/ui/panels.rs
- (new) src/ui/format.rs
Extraction plan
- Add shared utility in
src/ui/format.rs(e.g.format_scaled). - Refactor
format_rateto delegate while preserving0 => ""behavior. - Refactor
format_countto delegate while preserving integer-like output for small values. - Add tests for thresholds, rounding, and zero behavior.
Risk
Medium. String output changes can affect tests/UX expectations and may require deliberate compatibility decisions.
Acceptance criteria
- Shared formatting utility exists and is reused by rate/count formatters.
- Existing expected output behavior is preserved or intentionally updated with tests.
- Tests pass.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels