mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-10 02:08:21 +00:00
Format numbers with commas.
This commit is contained in:
parent
366d81a546
commit
c594dc51b2
@ -10,14 +10,14 @@
|
||||
|
||||
<p class="uk-dark">
|
||||
<font-awesome-icon icon="thumbs-up"></font-awesome-icon>
|
||||
<b>{{ video.likes }}</b>
|
||||
<b>{{ addCommas(video.likes) }}</b>
|
||||
|
||||
<font-awesome-icon icon="thumbs-down"></font-awesome-icon>
|
||||
<b>{{ video.dislikes }}</b>
|
||||
<b>{{ addCommas(video.dislikes) }}</b>
|
||||
</p>
|
||||
<p>
|
||||
<font-awesome-icon icon="eye"></font-awesome-icon>
|
||||
<b>{{ video.views }}</b> views
|
||||
<b>{{ addCommas(video.views) }}</b> views
|
||||
</p>
|
||||
<p>
|
||||
Uploaded on <b>{{ video.uploadDate }}</b>
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user