Codebase list golang-github-vbauerster-mpb / 89fb791
minor refactoring Vladimir Bauer 8 years ago
1 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
6565 if math.IsInf(v, 0) || math.IsNaN(v) {
6666 v = .0
6767 }
68 timeRemaining := time.Duration(st.Total-st.Current) * time.Duration(v)
69 hours := int64((timeRemaining / time.Hour) % 60)
70 minutes := int64((timeRemaining / time.Minute) % 60)
71 seconds := int64((timeRemaining / time.Second) % 60)
68 remaining := time.Duration((st.Total - st.Current) * int64(v))
69 hours := int64((remaining / time.Hour) % 60)
70 minutes := int64((remaining / time.Minute) % 60)
71 seconds := int64((remaining / time.Second) % 60)
7272
7373 var str string
7474 switch s.style {
7575 case ET_STYLE_GO:
76 str = fmt.Sprint(time.Duration(timeRemaining.Seconds()) * time.Second)
76 str = fmt.Sprint(time.Duration(remaining.Seconds()) * time.Second)
7777 case ET_STYLE_HHMMSS:
7878 str = fmt.Sprintf("%02d:%02d:%02d", hours, minutes, seconds)
7979 case ET_STYLE_HHMM: