-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Update short number format #4514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Update short number format by adding 2 decimal places instead of 1 for numbers between 1,000 and 9,999
@lulunac27a is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Updates the short number formatting function to use 2 decimal places for numbers between 1,000-9,999 instead of 1 decimal place, while maintaining 1 decimal place for numbers above 10,000.
- Modified the
kFormatter
function to use conditional precision based on number ranges - Added comprehensive test cases for the new formatting behavior
- Updated documentation to reflect the new formatting example
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/common/utils.js | Updated kFormatter function logic to use 2 decimal places for 1k-9.99k range |
tests/utils.test.js | Added test cases covering the new 2-decimal formatting for mid-range numbers |
readme.md | Updated documentation example from 6.6k to 6.62k to reflect new format |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @lulunac27a
Thank you for opening pull request. I appreciate your interest in our project.
Initially I was going to merge since generally the pull request looks good, but now I noticed that the kFormatter function is used also for extra pins and gist card which should replicate the GitHub's behavior.
Since the GitHub formatting pins in users profiles with 1 decimal precision by default I have doubts whether we should merge this. Also I don't feel good about the fact that our users will experience unexpected changes on their cards without actions on their side.
I think it would be better to provide query string parameter number_precision
to configure that behavior.
Please do that by adding |
Update short number format by adding 2 decimal places instead of 1 for numbers between 1,000 and 9,999