net worth calc

This commit is contained in:
Emil Lerch 2026-04-21 13:32:42 -07:00
parent f134e701d0
commit b3c1751eb6
Signed by: lobo
GPG key ID: A7B62D657EF764F8
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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})", .{