Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Thousands seperator for thousands #6

Merged
merged 3 commits into from
Jan 23, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/FeedItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
color="grey darken-4 white--text transparent"
label
>
{{ entry.views }} views
{{ entry.views | thousands_sep }} views
</v-chip>
</v-img>
<v-card-title class="subtitle-2 text-truncate d-block">{{ entry.title }}</v-card-title>
Expand All @@ -27,5 +27,11 @@ export default {
return `https://www.invidio.us/watch?v=${this.entry.id}`;
},
},
filters: {
thousands_sep(number) {
// return number;
jeyemwey marked this conversation as resolved.
Show resolved Hide resolved
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
},
},
};
</script>