Skip to content

Commit c0ae041

Browse files
committed
docs: format stars
1 parent 3cb60ea commit c0ae041

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/src/components/StarCount.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class="flex items-center text-xs font-bold font-body border-2 text-zinc-400 border-zinc-400 rounded-full px-3 py-1.5 hover:border-emerald-500 hover:text-emerald-500 select-none"
77
>
88
<Icon name="star" class="w-4 h-4 mr-1" />
9-
{{ count }}
9+
{{ format(count) }}
1010
</a>
1111
</template>
1212

@@ -19,6 +19,10 @@ const props = defineProps<{
1919
initialCount?: number;
2020
}>();
2121
22+
function format(number: number) {
23+
return number.toLocaleString();
24+
}
25+
2226
const count = ref(props.initialCount || 10000);
2327
2428
onMounted(async () => {

0 commit comments

Comments
 (0)