aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 5c64959..cd401e2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -181,6 +181,20 @@ fn output(account: Account, maybe_calculated: Option<Calculated>) {
println!();
+ for (n, owed) in calculated.total_owed.iter() {
+ println!(
+ "{} person(s) owe you in shared expenses: {:.2}",
+ n - 1,
+ owed,
+ );
+
+ if *n > 2 {
+ println!("Each owes you: {}", *owed / (*n as f64 - 1.0));
+ }
+
+ println!();
+ }
+
println!("Days until balance runs out:");
let days_left_output = format!(
@@ -192,6 +206,8 @@ fn output(account: Account, maybe_calculated: Option<Calculated>) {
calculated.days_left_essential,
);
+ // TODO: also show much money would be left by the end of the period
+
let mut all_are_healthy = true;
let mut essential_are_healthy = true;