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 (#1762)

The goatcounter PV report splits numbers with spaces, e.g. 1024 would be '1 024'
  • Loading branch information
cotes2020 committed May 18, 2024
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
Expand Up @@ -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';
Expand Down

0 comments on commit 33a1fa7

Please sign in to comment.