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'
  • Loading branch information
cotes2020 authored and gudtldn committed Jul 26, 2024
1 parent c7b021d commit d46b1ef
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 d46b1ef

Please sign in to comment.