Human friendly godoc test
Vladimir Bauer
8 years ago
| 102 | 102 | return Counters(pairFormat, 0, minWidth, conf) |
| 103 | 103 | } |
| 104 | 104 | |
| 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"`. | |
| 113 | 116 | func CountersKibiByte(pairFormat string, minWidth, conf int) DecoratorFunc { |
| 114 | 117 | return Counters(pairFormat, Unit_KiB, minWidth, conf) |
| 115 | 118 | } |