Skip to content

Conversation

lulunac27a
Copy link

Update short number format by adding 2 decimal places instead of 1 for numbers between 1,000 and 9,999

Update short number format by adding 2 decimal places instead of 1 for numbers between 1,000 and 9,999
Copy link

vercel bot commented Oct 5, 2025

@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.

@github-actions github-actions bot added the documentation Improvements or additions to documentation. label Oct 6, 2025
@qwerty541 qwerty541 requested a review from Copilot October 6, 2025 19:44
Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link
Collaborator

@qwerty541 qwerty541 left a 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.

@lulunac27a
Copy link
Author

Please do that by adding number_precision parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants