Refactor: Split Index page
Refactor Index.tsx into smaller, more manageable components.
This commit is contained in:
12
src/utils/formatters.ts
Normal file
12
src/utils/formatters.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
export const formatCurrency = (amount: number): string => {
|
||||
return new Intl.NumberFormat('ko-KR', {
|
||||
style: 'currency',
|
||||
currency: 'KRW',
|
||||
maximumFractionDigits: 0
|
||||
}).format(amount);
|
||||
};
|
||||
|
||||
export const calculatePercentage = (spent: number, target: number): number => {
|
||||
return Math.min(Math.round(spent / target * 100), 100);
|
||||
};
|
||||
Reference in New Issue
Block a user