diff --git a/resources/js/components/posts/PostPlatformMetrics.vue b/resources/js/components/posts/PostPlatformMetrics.vue
index 65946d83..bf4fb35c 100644
--- a/resources/js/components/posts/PostPlatformMetrics.vue
+++ b/resources/js/components/posts/PostPlatformMetrics.vue
@@ -9,6 +9,7 @@ import {
TooltipProvider,
TooltipTrigger,
} from '@/components/ui/tooltip';
+import { formatNumberCompact } from '@/lib/utils';
import { metrics as metricsRoute } from '@/routes/app/posts/platforms';
interface Metric {
@@ -39,13 +40,6 @@ const reactions = computed(() =>
const hasMetrics = computed(() => metrics.value.length > 0);
-const formatNumber = (n: number): string => {
- if (n >= 1_000_000)
- return (n / 1_000_000).toFixed(1).replace(/\.0$/, '') + 'M';
- if (n >= 1_000) return (n / 1_000).toFixed(1).replace(/\.0$/, '') + 'K';
- return n.toString();
-};
-
const http = useHttp
- {{ formatNumber(metric.value) }} + {{ formatNumberCompact(metric.value) }}
@@ -116,7 +110,7 @@ onMounted(async () => { >