diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 8d1a7845..940467f9 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -10,14 +10,14 @@

- {{ video.likes }} + {{ addCommas(video.likes) }}   - {{ video.dislikes }} + {{ addCommas(video.dislikes) }}

- {{ video.views }} views + {{ addCommas(video.views) }} views

Uploaded on {{ video.uploadDate }} diff --git a/src/main.js b/src/main.js index dcaaf273..e45cdaed 100644 --- a/src/main.js +++ b/src/main.js @@ -49,6 +49,10 @@ const mixin = { } return (num / si[i].value).toFixed(digits).replace(rx, "$1") + si[i].symbol; }, + addCommas(num) { + num = parseInt(num) + return num.toLocaleString('en-US') + }, fetchJson: function (url, options) { return fetch(url, options).then(response => { return response.json();