update slider once per second always

This commit is contained in:
Drew Weymouth
2022-12-23 14:55:47 -08:00
parent af24ec56a8
commit 024557d49e
4 changed files with 13 additions and 25 deletions
+5 -2
View File
@@ -1,13 +1,16 @@
package ui
import "fmt"
import (
"fmt"
"math"
)
func SecondsToTimeString(s float64) string {
if s < 0 {
s = 0
}
min := int(s / 60)
sec := int(s - float64(min*60))
sec := int(math.Round(s - float64(min*60)))
return fmt.Sprintf("%2d:%02d", min, sec)
}