From 24ac0a0fbe598c4bc695ba712cc4da454665529a Mon Sep 17 00:00:00 2001 From: thatscringebro Date: Wed, 10 Dec 2025 14:46:45 -0500 Subject: [PATCH] grand total --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 4babf35..fd2a14d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,14 +37,18 @@ fn main() { match choice { "1" => { let accounts = data_layer::get_accounts(&connection); + let mut total = 0.0; for ac in accounts.iter() { + let ac_total = ac.get_total(&connection); println!( "Id: {}, Name: {}, Total: {}", ac.get_id(), ac.get_name(), - ac.get_total(&connection) + ac_total ); + total += ac_total; } + println!("Total: {}", total); } "2" => { println!("Please enter the account name:");