fixup! consistent default format "% d" among percentage/counters/speed
Vladimir Bauer
3 years ago
| 38 | 38 | // pairFmt="% f / % f" output: "1.000000 MB / 12.000000 MB" |
| 39 | 39 | func Counters(unit interface{}, pairFmt string, wcc ...WC) Decorator { |
| 40 | 40 | if pairFmt == "" { |
| 41 | pairFmt = "%d / %d" | |
| 41 | pairFmt = "% d / % d" | |
| 42 | 42 | } |
| 43 | 43 | producer := func() DecorFunc { |
| 44 | 44 | switch unit.(type) { |
| 94 | 94 | // format="% f" output: "12.000000 MiB" |
| 95 | 95 | func Total(unit interface{}, format string, wcc ...WC) Decorator { |
| 96 | 96 | if format == "" { |
| 97 | format = "%d" | |
| 97 | format = "% d" | |
| 98 | 98 | } |
| 99 | 99 | producer := func() DecorFunc { |
| 100 | 100 | switch unit.(type) { |
| 206 | 206 | // format="% f" output: "12.000000 MiB" |
| 207 | 207 | func InvertedCurrent(unit interface{}, format string, wcc ...WC) Decorator { |
| 208 | 208 | if format == "" { |
| 209 | format = "%d" | |
| 209 | format = "% d" | |
| 210 | 210 | } |
| 211 | 211 | producer := func() DecorFunc { |
| 212 | 212 | switch unit.(type) { |