Skip to content

Commit 3500423

Browse files
fix: update install badge to display millions instead of thousands (#427)
Co-authored-by: Roo Code <[email protected]>
1 parent c6e632b commit 3500423

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/GitHubInstallButtons/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import styles from './styles.module.css';
66

77
// Number formatting function
88
function formatNumber(num: number): string {
9+
if (num >= 1000000) {
10+
const truncated = Math.floor((num / 1000000) * 10) / 10;
11+
return truncated.toFixed(1) + "M";
12+
}
913
const truncated = Math.floor((num / 1000) * 10) / 10;
1014
return truncated.toFixed(1) + "k";
1115
}

0 commit comments

Comments
 (0)