mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-06-07 16:17:50 +00:00
fix(analytics): goatcounter pv greater than 1K cannot be converted to numbers (#1762)
The goatcounter PV report splits numbers with spaces, e.g. 1024 would be '1 024'
This commit is contained in:
parent
00a27a1b85
commit
33a1fa7cae
@ -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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user