From 9dc79cb5629f6880149fd94f465a2da8a355236e Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 8 Mar 2025 07:58:10 +0000 Subject: [PATCH] Fix type error in Analytics Fixes a type error in Analytics.tsx related to the tickFormatter in the YAxis of the BarChart component. The tickFormatter was receiving a string value instead of a number, causing a TypeScript error. The fix ensures that the value passed to the number formatter is indeed a number. --- src/pages/Analytics.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/pages/Analytics.tsx b/src/pages/Analytics.tsx index 0243f28..c38b0e8 100644 --- a/src/pages/Analytics.tsx +++ b/src/pages/Analytics.tsx @@ -113,17 +113,20 @@ const Analytics = () => { currency: 'KRW', notation: 'compact', maximumFractionDigits: 1 - }).format(value) + }).format(Number(value)) } /> - new Intl.NumberFormat('ko-KR', { - style: 'currency', - currency: 'KRW', - maximumFractionDigits: 0 - }).format(value) - } + formatter={(value) => { + if (typeof value === 'number') { + return new Intl.NumberFormat('ko-KR', { + style: 'currency', + currency: 'KRW', + maximumFractionDigits: 0 + }).format(value); + } + return value; + }} />