net worth calc
This commit is contained in:
parent
f134e701d0
commit
b3c1751eb6
2 changed files with 2 additions and 2 deletions
|
|
@ -511,7 +511,7 @@ pub fn display(
|
||||||
// Net Worth (if illiquid assets exist)
|
// Net Worth (if illiquid assets exist)
|
||||||
if (portfolio.hasType(.illiquid)) {
|
if (portfolio.hasType(.illiquid)) {
|
||||||
const illiquid_total = portfolio.totalIlliquid();
|
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 nw_buf: [24]u8 = undefined;
|
||||||
var liq_buf: [24]u8 = undefined;
|
var liq_buf: [24]u8 = undefined;
|
||||||
var il_buf: [24]u8 = undefined;
|
var il_buf: [24]u8 = undefined;
|
||||||
|
|
|
||||||
|
|
@ -810,7 +810,7 @@ pub fn drawContent(app: *App, arena: std.mem.Allocator, buf: []vaxis.Cell, width
|
||||||
if (app.portfolio) |pf| {
|
if (app.portfolio) |pf| {
|
||||||
if (pf.hasType(.illiquid)) {
|
if (pf.hasType(.illiquid)) {
|
||||||
const illiquid_total = pf.totalIlliquid();
|
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 nw_buf: [24]u8 = undefined;
|
||||||
var il_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})", .{
|
const nw_text = try std.fmt.allocPrint(arena, " Net Worth: {s} (Liquid: {s} Illiquid: {s})", .{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue