mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-13 13:50:27 +05:30
Format numbers with commas.
This commit is contained in:
parent
366d81a546
commit
c594dc51b2
@ -10,14 +10,14 @@
|
|||||||
|
|
||||||
<p class="uk-dark">
|
<p class="uk-dark">
|
||||||
<font-awesome-icon icon="thumbs-up"></font-awesome-icon>
|
<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>
|
<font-awesome-icon icon="thumbs-down"></font-awesome-icon>
|
||||||
<b>{{ video.dislikes }}</b>
|
<b>{{ addCommas(video.dislikes) }}</b>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<font-awesome-icon icon="eye"></font-awesome-icon>
|
<font-awesome-icon icon="eye"></font-awesome-icon>
|
||||||
<b>{{ video.views }}</b> views
|
<b>{{ addCommas(video.views) }}</b> views
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Uploaded on <b>{{ video.uploadDate }}</b>
|
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;
|
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) {
|
fetchJson: function (url, options) {
|
||||||
return fetch(url, options).then(response => {
|
return fetch(url, options).then(response => {
|
||||||
return response.json();
|
return response.json();
|
||||||
|
Loading…
Reference in New Issue
Block a user