clean up perf
This commit is contained in:
parent
88241b2c7b
commit
31d49d4432
2 changed files with 2 additions and 4 deletions
|
|
@ -124,7 +124,7 @@ pub fn printReturnsTable(
|
||||||
);
|
);
|
||||||
|
|
||||||
if (price_arr[i] != null) {
|
if (price_arr[i] != null) {
|
||||||
try cli.setGainLoss(out, color, if (row.price_positive) @as(f64, 1) else @as(f64, -1));
|
try cli.setGainLoss(out, color, if (row.price_positive) 1.0 else -1.0);
|
||||||
} else {
|
} else {
|
||||||
try cli.setFg(out, color, cli.CLR_MUTED);
|
try cli.setFg(out, color, cli.CLR_MUTED);
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +133,7 @@ pub fn printReturnsTable(
|
||||||
|
|
||||||
if (has_total) {
|
if (has_total) {
|
||||||
if (row.total_str) |ts| {
|
if (row.total_str) |ts| {
|
||||||
try cli.setGainLoss(out, color, if (row.price_positive) @as(f64, 1) else @as(f64, -1));
|
try cli.setGainLoss(out, color, if (row.price_positive) 1.0 else -1.0);
|
||||||
try out.print(" {s:>13}", .{ts});
|
try out.print(" {s:>13}", .{ts});
|
||||||
try cli.reset(out, color);
|
try cli.reset(out, color);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,6 @@ pub fn buildStyledLines(self: *App, arena: std.mem.Allocator) ![]const StyledLin
|
||||||
}
|
}
|
||||||
try lines.append(arena, .{ .text = "", .style = th.contentStyle() });
|
try lines.append(arena, .{ .text = "", .style = th.contentStyle() });
|
||||||
|
|
||||||
if (self.candles == null and !self.perf_loaded) self.loadPerfData();
|
|
||||||
|
|
||||||
if (self.trailing_price == null) {
|
if (self.trailing_price == null) {
|
||||||
try lines.append(arena, .{ .text = try std.fmt.allocPrint(arena, " No data. Run: zfin perf {s}", .{self.symbol}), .style = th.mutedStyle() });
|
try lines.append(arena, .{ .text = try std.fmt.allocPrint(arena, " No data. Run: zfin perf {s}", .{self.symbol}), .style = th.mutedStyle() });
|
||||||
return lines.toOwnedSlice(arena);
|
return lines.toOwnedSlice(arena);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue