Format download and package counts with toLocaleString()

This commit is contained in:
Steve Purcell 2014-08-22 09:52:49 +01:00
parent 671afe0ff3
commit 8b6c18f5e4

View file

@ -209,10 +209,10 @@
return m("section#packages", [ return m("section#packages", [
m("h2", [ m("h2", [
"Current List of ", "Current List of ",
ctrl.packageList().totalPackages(), ctrl.packageList().totalPackages().toLocaleString(),
" Packages ", " Packages ",
m("small", [ m("small", [
ctrl.packageList().totalDownloads(), ctrl.packageList().totalDownloads().toLocaleString(),
" downloads to date" " downloads to date"
]) ])
]), ]),
@ -247,7 +247,7 @@
m("td.source", [ m("td.source", [
p.sourceURL ? m("a", {href: p.sourceURL}, [p.source]) : p.source p.sourceURL ? m("a", {href: p.sourceURL}, [p.source]) : p.source
]), ]),
m("td", [p.downloads]) m("td", [p.downloads.toLocaleString()])
]); ]);
})) }))
]) ])
@ -309,7 +309,7 @@
m("dl.dl-horizontal", [ m("dl.dl-horizontal", [
m("dt", "Downloads"), m("dt", "Downloads"),
m("dd", [ m("dd", [
pkg.downloads, pkg.downloads.toLocaleString(),
m("span.muted", " (all versions)"), m("span.muted", " (all versions)"),
", percentile: ", ", percentile: ",
ctrl.downloadsPercentile().toFixed(2) ctrl.downloadsPercentile().toFixed(2)