Skip to content

Commit f7e5116

Browse files
authored
feat(overview): make weekly downloads more readable (#545)
1 parent c7cb8ab commit f7e5116

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

public/components/package/pannels/overview/overview.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@ export class Overview {
182182
} = await fetch(`/downloads/${name.replaceAll("/", "%2F")}`)
183183
.then((value) => value.json());
184184

185-
document.querySelector("#npm-stats .weekly-downloads").textContent = downloads ?? "N/A";
185+
const numberFormat = new Intl.NumberFormat();
186+
187+
document.querySelector("#npm-stats .weekly-downloads").textContent = downloads ? numberFormat.format(downloads) : "N/A";
186188
document.querySelector("#npm-stats .weekly-traffic").textContent = downloads ? prettyBytes(downloads * size) : "N/A";
187189
}
188190

0 commit comments

Comments
 (0)