blob: 7c7a50856969e425929149e74850980cf7878a2c (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package progress
import (
"fmt"
"codeberg.org/lindenii/furgit/internal/intconv"
)
func (meter *Meter) renderCounters() string {
if meter.total > 0 {
u, err := intconv.Uint64ToInt(meter.lastDone * 100 / meter.total)
if err != nil {
return "overflow"
// TODO
}
meter.lastPercent = u
return fmt.Sprintf("%3d%% (%d/%d)%s", meter.lastPercent, meter.lastDone, meter.total, meter.throughputSuffix)
}
return fmt.Sprintf("%d%s", meter.lastDone, meter.throughputSuffix)
}
|