diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 538cb59..fd3b9ee 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -1,3 +1,4 @@ + import React, { useState } from 'react'; import NavBar from '@/components/NavBar'; import BudgetCard from '@/components/BudgetCard'; @@ -57,6 +58,12 @@ const Index = () => { maximumFractionDigits: 0 }).format(amount); }; + + // 퍼센트 계산 함수 + const calculatePercentage = (spent: number, target: number) => { + return Math.min(Math.round((spent / target) * 100), 100); + }; + return