From b3c1751eb6661663f7e55250fdeb5f84c820d464 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Tue, 21 Apr 2026 13:32:42 -0700 Subject: [PATCH] net worth calc --- src/commands/portfolio.zig | 2 +- src/tui/portfolio_tab.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/portfolio.zig b/src/commands/portfolio.zig index 5710855..c42a18a 100644 --- a/src/commands/portfolio.zig +++ b/src/commands/portfolio.zig @@ -511,7 +511,7 @@ pub fn display( // Net Worth (if illiquid assets exist) if (portfolio.hasType(.illiquid)) { const illiquid_total = portfolio.totalIlliquid(); - const net_worth = summary.total_value + illiquid_total; + const net_worth = zfin.valuation.netWorth(portfolio.*, summary.*); var nw_buf: [24]u8 = undefined; var liq_buf: [24]u8 = undefined; var il_buf: [24]u8 = undefined; diff --git a/src/tui/portfolio_tab.zig b/src/tui/portfolio_tab.zig index ba20193..94a5079 100644 --- a/src/tui/portfolio_tab.zig +++ b/src/tui/portfolio_tab.zig @@ -810,7 +810,7 @@ pub fn drawContent(app: *App, arena: std.mem.Allocator, buf: []vaxis.Cell, width if (app.portfolio) |pf| { if (pf.hasType(.illiquid)) { const illiquid_total = pf.totalIlliquid(); - const net_worth = s.total_value + illiquid_total; + const net_worth = zfin.valuation.netWorth(pf, s); var nw_buf: [24]u8 = undefined; var il_buf: [24]u8 = undefined; const nw_text = try std.fmt.allocPrint(arena, " Net Worth: {s} (Liquid: {s} Illiquid: {s})", .{