Skip to content

Commit

Permalink
fix(analytics): goatcounter pv greater than 1K cannot be converted to…
Browse files Browse the repository at this point in the history
… numbers (cotes2020#1762)

The goatcounter PV report splits numbers with spaces, e.g. 1024 would be '1 024'
cotes2020 authored May 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 00a27a1 commit 33a1fa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _includes/pageviews/goatcounter.html
Original file line number Diff line number Diff line change
@@ -9,7 +9,8 @@
fetch(url)
.then((response) => response.json())
.then((data) => {
pv.innerText = new Intl.NumberFormat().format(data.count);
const count = data.count.replace(/\s/g, '');
pv.innerText = new Intl.NumberFormat().format(count);
})
.catch((error) => {
pv.innerText = '1';

0 comments on commit 33a1fa7

Please sign in to comment.