Codebase list golang-github-vbauerster-mpb / 29d2540
Convenience functions CountersKibiByte and CountersKiloByte Vladimir Bauer 8 years ago
1 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
8989 return Counters(pairFormat, 0, minWidth, conf)
9090 }
9191
92 // CountersKibiByte returns human friendly byte counters decorator, where
93 // counters unit is multiple by 1024.
94 func CountersKibiByte(pairFormat string, minWidth int, conf byte) DecoratorFunc {
95 return Counters(pairFormat, Unit_KiB, minWidth, conf)
96 }
97
98 // CountersKiloByte returns human friendly byte counters decorator, where
99 // counters unit is multiple by 1000.
100 func CountersKiloByte(pairFormat string, minWidth int, conf byte) DecoratorFunc {
101 return Counters(pairFormat, Unit_kB, minWidth, conf)
102 }
103
92104 // Counters provides basic counters decorator.
93105 // pairFormat must contain two printf compatible verbs, like "%f" or "%d".
94106 // First verb substituted with Current, second one with Total. For example (assuming decor.Unit_KiB used):