Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: PR #47523: fix(tui): roll over compact counts to M at 999,950 This is the exact same fix addressing the same issue—rolling over compact number formatting to display "M" at the 999,950 threshold instead of showing "1000.0K". Since PR #47523 already exists with identical scope and solution, PR #48969 appears to be a duplicate. |
Author
|
Same as above — the body links |
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.
Issue for this PR
Closes #33947
Type of change
What does this PR do?
Locale.number()formats the thousands value withtoFixed(1), so any count from 999,950 to 999,999 rounds to1000.0and renders as1000.0K. The>= 1000000branch never gets a chance to promote it, because the count itself is still under a million. It shows up in the TUI context indicator on ~1M token context models, e.g.1000.0K (100%).Rolling over at 999,950 — the point where one-decimal rounding first reaches
1000.0K— makes those values render as1.0M. Nothing below that boundary changes.How did you verify your code works?
Added a case to
packages/tui/test/util/locale.test.ts: 999,949 still formats as999.9K, 999,950 and 999,999 now format as1.0M, plus the plain/K/M cases so the fix can't regress them. 3/3 pass in that file.No screenshot — reproducing it in the UI needs a session grown to ~999,950 tokens, so the boundary is covered by the unit test instead.
Checklist