(num: number)
| 14 | * Formats a raw star count for display (e.g. 28900 → "28.9k"). |
| 15 | */ |
| 16 | export function formatStarCount(num: number): string { |
| 17 | if (num < 1000) return String(num) |
| 18 | const formatted = (Math.round(num / 100) / 10).toFixed(1) |
| 19 | return formatted.endsWith('.0') ? `${formatted.slice(0, -2)}k` : `${formatted}k` |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Fetches the Sim repository's GitHub star count, formatted for display. |