This commit is contained in:
Kovid Goyal
2023-07-25 09:26:34 +05:30
parent 44190c4220
commit 9694bd03d8
2 changed files with 2 additions and 2 deletions

View File

@@ -463,7 +463,7 @@ func render_duration(val time.Duration) (ans string) {
ans = zero_pad(hr) + `:` + zero_pad(min) + `:` + zero_pad(secs)
}
} else {
ans = "<1s"
ans = "<1 sec"
}
if w := wcswidth.Stringwidth(ans); w < 8 {
ans = strings.Repeat(" ", 8-w) + ans

View File

@@ -109,7 +109,7 @@ func TestRenderDuration(t *testing.T) {
t.Fatalf("Failed for %f (%s): %s", i, d, diff)
}
}
q(0.1, " <1s")
q(0.1, " <1 sec")
q(1, `00:00:01`)
q(1.1234567, `00:00:01`)
q(60.1234567, `00:01:00`)