kettlebell-tracker/internal/ui/utils/format.go

12 lines
224 B
Go

package utils
import "fmt"
func FormatDuration(totalSeconds int64) string {
if totalSeconds < 0 {
totalSeconds = 0
}
mins := totalSeconds / 60
secs := totalSeconds % 60
return fmt.Sprintf("%02d:%02d", mins, secs)
}