// FormatRate format value to string, or nothing if 0. // func FormatRate(size uint64) string { if size > 0 { return bytesize.ByteSize(size).String() } return "" }
// Label display callback. One line for each device. Format="eth0: ↓ 42 / ↑ 128". // func formatLabel(dev string, in, out uint64) string { return fmt.Sprintf("%s: %s %s / %s %s", dev, "↓", bytesize.ByteSize(in), "↑", bytesize.ByteSize(out)) }
// Label display callback. One line for each device. Format="eth0: r 42 / w 128". // func formatLabel(dev string, in, out uint64) string { return fmt.Sprintf("%s: %s %s / %s %s", dev, "r", bytesize.ByteSize(in*BlockSize), "w", bytesize.ByteSize(out*BlockSize)) }