Skip to content

Commit 70c886e

Browse files
Enhance budget message to include overspent amount
1 parent f9335e3 commit 70c886e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/app/features/budget/budget.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ export class BudgetComponent implements OnInit {
295295
this.totalSpent = spent.toFixed(2);
296296
this.totalBudget = totalBudget.toFixed(2);
297297
this.remainingBudgets = '0';
298-
this.budgetMessage = `⚠️ You have exceeded your budget!`;
298+
const overSpent = (spent - totalBudget).toFixed(2);
299+
this.budgetMessage = `⚠️ You have exceeded your budget by ${overSpent}!`;
299300
} else {
300301
this.totalSpent = spent.toFixed(2);
301302
this.totalBudget = totalBudget.toFixed(2);

0 commit comments

Comments
 (0)