Skip to content

Improve GitHub stars display precision to tenths of thousands#55

Merged
MarcinZiabek merged 1 commit into
mainfrom
copilot/adjust-rounding-algorithm
Jun 1, 2026
Merged

Improve GitHub stars display precision to tenths of thousands#55
MarcinZiabek merged 1 commit into
mainfrom
copilot/adjust-rounding-algorithm

Conversation

Copilot AI commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

toThousands was rounding to the nearest 1,000, causing e.g. 14,270 stars to display as 14K instead of 14.3K.

Changes

  • toThousands: rounds to the nearest 100 and returns one decimal place
// Before
Math.round(n / 1_000)       // 14270 → 14

// After
Math.round(n / 100) / 10    // 14270 → 14.3

@MarcinZiabek MarcinZiabek marked this pull request as ready for review June 1, 2026 16:59
Copilot AI review requested due to automatic review settings June 1, 2026 16:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the GitHub stars “K” formatting logic in the VitePress theme so star counts are displayed with tenths-of-a-thousand precision (e.g., 14,270 → 14.3K) instead of rounding to whole thousands.

Changes:

  • Update toThousands rounding logic from nearest 1,000 to nearest 100 (i.e., tenths of a thousand).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/.vitepress/theme/statistics.data.ts
@MarcinZiabek MarcinZiabek merged commit b58305b into main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants