fix off-by-one error

This commit is contained in:
Jeffrey C. Ollie
2024-08-02 15:41:14 -05:00
parent 3aa1989620
commit cf515c80d0

View File

@ -3899,7 +3899,7 @@ pub const Duration = struct {
var i: usize = 0;
for (units) |unit| {
if (value > unit.factor) {
if (value >= unit.factor) {
if (i > 0) writer.writeAll(" ") catch unreachable;
const remainder = value % unit.factor;
const quotient = (value - remainder) / unit.factor;