Repository navigation
fix: shorten counts from a thousand, not only above it - #445
Merged
xHeaven merged 1 commit intoOct 18, 2026
Merged
Conversation
jubianchi
marked this pull request as ready for review
October 18, 2026 14:52
formatCount compared with a strict greater-than, so 999 read 999, 1001 read 1k, and 1000 alone read 1000: four characters where the star counts and the aside stats expect at most three. Counting from a thousand gives 1k, as the compact formatter already does for every larger number. 🤖 Generated with Claude Code
jubianchi
force-pushed
the
fix/format-count-threshold
branch
from
October 18, 2026 15:39
20b1ef1 to
02d36a0
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.
formatCountcompares with a strict greater-than, so 999 reads999, 1001 reads1k, and 1000 alone reads1000: four characters where the star counts and the aside stats expect at most three (#410).Fix
Count from a thousand (
>=), which gives1k, as the compact formatter already does for every larger number.Test
tests/Unit/Numbers.test.ts, written first and failing on the 1000 case (actual: '1000', expected: '1k'), covers both sides of the threshold and a few larger values (1.5k,10k,1m,2.3m). It runs with the existingtest:unitscript.Verification
node --experimental-strip-types --test tests/Unit/Numbers.test.ts: 2 passedvp fmt --check,vp lint,tsc --noEmit --project tests/tsconfig.json: clean