diff --git a/progressBar.go b/progressBar.go index 5036212..2fcac98 100644 --- a/progressBar.go +++ b/progressBar.go @@ -58,6 +58,6 @@ func (s *progressBar) updateProgress(conn mpd.Client){ du , err := strconv.ParseFloat(_status["duration"], 8) percentage := el / du * 100 if err == nil && err1 == nil{ - s.t.GetCell(1,0).Text = getText(float64(_width), percentage, convertToStrings(el) + "/" + convertToStrings(du) + "(" + strconv.FormatFloat(percentage, 'f', 2, 32) + "%" + ")") + s.t.GetCell(1,0).Text = getText(float64(_width), percentage, strTime(el) + "/" + strTime(du) + "(" + strconv.FormatFloat(percentage, 'f', 2, 32) + "%" + ")") } } diff --git a/utils.go b/utils.go index 3d8c7bf..556cb3f 100644 --- a/utils.go +++ b/utils.go @@ -4,7 +4,7 @@ import( "strconv" ) -func convertToStrings(e float64) string{ +func strTime(e float64) string{ a := int(e) var min, seconds string if (a/60 < 10){