use 0 instead of .0
Vladimir Bauer
8 years ago
| 75 | 75 | |
| 76 | 76 | v := internal.Round(s.average.Value()) |
| 77 | 77 | if math.IsInf(v, 0) || math.IsNaN(v) { |
| 78 | v = .0 | |
| 78 | v = 0 | |
| 79 | 79 | } |
| 80 | 80 | remaining := time.Duration((st.Total - st.Current) * int64(v)) |
| 81 | 81 | hours := int64((remaining / time.Hour) % 60) |
| 141 | 141 | return DecoratorFunc(func(st *Statistics, widthAccumulator chan<- int, widthDistributor <-chan int) string { |
| 142 | 142 | var str string |
| 143 | 143 | timeElapsed := time.Since(startTime) |
| 144 | ||
| 145 | 144 | v := internal.Round(float64(timeElapsed) / float64(st.Current)) |
| 146 | 145 | if math.IsInf(v, 0) || math.IsNaN(v) { |
| 147 | v = .0 | |
| 146 | v = 0 | |
| 148 | 147 | } |
| 149 | 148 | remaining := time.Duration((st.Total - st.Current) * int64(v)) |
| 150 | 149 | hours := int64((remaining / time.Hour) % 60) |