srctree

Gregory Mullen parent 74eb46ec 2cd35efe
add minutes to batter timer

inlinesplit
src/battery.zig added: 3, removed: 3, total 0
@@ -34,8 +34,8 @@ pub fn ttl(self: Battery) ![]u8 {
const ttlbuf = struct {
var buf: [12]u8 = undefined;
};
const time: usize = 4 *| @as(usize, @intCast(self.capacity)) / 100;
return try std.fmt.bufPrint(&ttlbuf.buf, "{}h00m", .{time});
const time: usize = 240 *| @as(usize, @intCast(self.capacity)) / 100;
return try std.fmt.bufPrint(&ttlbuf.buf, "{}h{}m", .{ time / 60, time % 60 });
}
 
pub fn format(self: Battery, comptime fmt: []const u8, _: std.fmt.FormatOptions, out: anytype) !void {