Codebase list golang-github-vbauerster-mpb / 8c3a534
Human friendly godoc test Vladimir Bauer 8 years ago
1 changed file(s) with 11 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
102102 return Counters(pairFormat, 0, minWidth, conf)
103103 }
104104
105 // CountersKibiByte returns human friendly byte counters decorator,
106 // where counters unit is multiple by 1024.
107 // `pairFormat` must contain two printf compatible verbs, like "%f" or "%d".
108 // First verb substituted with Current, second one with Total.
109 // Example: `"%.1f / %.1f" = "1.0MiB / 12.0MiB"` or `"% .1f / % .1f" = "1.0 MiB / 12.0 MiB"`.
110 // If you set `DwidthSync` bit in `conf` param, `minWidth` param is ignored.
111 // `DwidthSync` is effective with multiple bars only, if set decorator will participate
112 // in width synchronization process with other decorators in the same column group.
105 // CountersKibiByte returns human friendly byte counters decorator, where counters unit is multiple by 1024.
106 //
107 // `pairFormat` printf compatible verbs for current and total, like "%f" or "%d".
108 //
109 // `minWidth` minimum width to apply, if `DwidthSync` bit is not set.
110 //
111 // `conf` bit set config, [DidentRight|DwidthSync|DextraSpace]
112 //
113 // pairFormat example:
114 //
115 // `"%.1f / %.1f" = "1.0MiB / 12.0MiB"` or `"% .1f / % .1f" = "1.0 MiB / 12.0 MiB"`.
113116 func CountersKibiByte(pairFormat string, minWidth, conf int) DecoratorFunc {
114117 return Counters(pairFormat, Unit_KiB, minWidth, conf)
115118 }