diff --git a/apps/site/src/components/hero.astro b/apps/site/src/components/hero.astro index 7619be10..ebf7e1cf 100644 --- a/apps/site/src/components/hero.astro +++ b/apps/site/src/components/hero.astro @@ -209,10 +209,17 @@ const copy = siteCopy[locale].hero; (function () { function formatCount(count) { if (typeof count !== "number") return String(count); - if (count >= 1000) { - return (count / 1000).toFixed(1).replace(/\.0$/, "") + "k"; + try { + return new Intl.NumberFormat("en", { + notation: "compact", + maximumFractionDigits: 1, + }).format(count).toLowerCase(); + } catch (e) { + if (count >= 1000) { + return (Math.round(count / 100) / 10).toFixed(1).replace(/\.0$/, "") + "k"; + } + return count.toLocaleString(); } - return count.toLocaleString(); } async function fetchGitHubStats() {