Fix: Import calculatePercentage from formatters

The `calculatePercentage` function was not being imported correctly from the formatters module, causing a build error. This commit fixes the import statement to correctly import the function.
This commit is contained in:
gpt-engineer-app[bot]
2025-04-05 05:43:05 +00:00
parent 62551d58e3
commit d96a43ef44

View File

@@ -25,3 +25,10 @@ export const formatWithCommas = (value: string): string => {
// 기존 쉼표 제거 후 다시 포맷팅
return addCommas(removeCommas(value));
};
// 지출 비율 계산 함수 추가
export const calculatePercentage = (spent: number, target: number): number => {
if (target === 0) return 0;
return Math.min(Math.round((spent / target) * 100), 100);
};