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.
This commit is contained in:
@@ -113,17 +113,20 @@ const Analytics = () => {
|
||||
currency: 'KRW',
|
||||
notation: 'compact',
|
||||
maximumFractionDigits: 1
|
||||
}).format(value)
|
||||
}).format(Number(value))
|
||||
}
|
||||
/>
|
||||
<Tooltip
|
||||
formatter={(value) =>
|
||||
new Intl.NumberFormat('ko-KR', {
|
||||
formatter={(value) => {
|
||||
if (typeof value === 'number') {
|
||||
return new Intl.NumberFormat('ko-KR', {
|
||||
style: 'currency',
|
||||
currency: 'KRW',
|
||||
maximumFractionDigits: 0
|
||||
}).format(value)
|
||||
}).format(value);
|
||||
}
|
||||
return value;
|
||||
}}
|
||||
/>
|
||||
<Legend />
|
||||
<Bar
|
||||
|
||||
Reference in New Issue
Block a user