Skip to content

Commit 33a1fa7

Browse files
authored
fix(analytics): goatcounter pv greater than 1K cannot be converted to numbers (cotes2020#1762)
The goatcounter PV report splits numbers with spaces, e.g. 1024 would be '1 024'
1 parent 00a27a1 commit 33a1fa7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

_includes/pageviews/goatcounter.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
fetch(url)
1010
.then((response) => response.json())
1111
.then((data) => {
12-
pv.innerText = new Intl.NumberFormat().format(data.count);
12+
const count = data.count.replace(/\s/g, '');
13+
pv.innerText = new Intl.NumberFormat().format(count);
1314
})
1415
.catch((error) => {
1516
pv.innerText = '1';

0 commit comments

Comments
 (0)