Skip to content

Commit 2fdb9b7

Browse files
committed
chore: add number formatting
1 parent aeaa38e commit 2fdb9b7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pages/datasets/[datasetid]/index.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ const tabs = reactive([
5757
shownInMini: true,
5858
},
5959
]);
60+
61+
const formatter = Intl.NumberFormat("en", { notation: "compact" });
62+
6063
const totalViewCount = ref(0);
6164
const totalDownloadApprovals = ref(0);
6265
const totalDownloadApprovalforAllVersions = ref(0);
@@ -686,11 +689,11 @@ const onTabChange = () => {
686689

687690
<div v-else class="min-w-[36px] text-sm font-medium">
688691
<div v-if="currentTab === 'currentVersion'">
689-
{{ totalViewCount }}
692+
{{ formatter.format(totalViewCount || 0) }}
690693
</div>
691694

692695
<div v-else>
693-
{{ totalViewCount }}
696+
{{ formatter.format(totalViewCount || 0) }}
694697
</div>
695698
</div>
696699
</TransitionFade>
@@ -713,11 +716,11 @@ const onTabChange = () => {
713716

714717
<div v-else class="min-w-[36px] text-sm font-medium">
715718
<div v-if="currentTab === 'currentVersion'">
716-
{{ totalViewCount }}
719+
{{ formatter.format(totalViewCount || 0) }}
717720
</div>
718721

719722
<div v-else>
720-
{{ totalViewCount }}
723+
{{ formatter.format(totalViewCount || 0) }}
721724
</div>
722725
</div>
723726
</TransitionFade>

0 commit comments

Comments
 (0)