fix minute changeover bug in secondsToTimeString

This commit is contained in:
Drew Weymouth
2022-12-27 12:26:12 -08:00
parent aa47426744
commit 586c694e59
+3 -2
View File
@@ -9,8 +9,9 @@ func SecondsToTimeString(s float64) string {
if s < 0 { if s < 0 {
s = 0 s = 0
} }
min := int(s / 60) sec := int(math.Round(s))
sec := int(math.Round(s - float64(min*60))) min := sec / 60
sec -= min * 60
return fmt.Sprintf("%2d:%02d", min, sec) return fmt.Sprintf("%2d:%02d", min, sec)
} }