repart: tweak byte value output
So far, when outputing information about copy progress we'd suppress the digit after the dot if it is zero. That makes the progress bar a bit "jumpy", because sometimes there are two more character cells used than other times. Let's just always output one digit after the dot here hence, to avoid this.
This commit is contained in:
@@ -39,7 +39,8 @@ char* format_bytes_full(char *buf, size_t l, uint64_t t, FormatBytesFlag flag) {
|
||||
(t / table[i + 1].factor * 10 / table[n - 1].factor) % 10 :
|
||||
(t * 10 / table[i].factor) % 10;
|
||||
|
||||
if (FLAGS_SET(flag, FORMAT_BYTES_BELOW_POINT) && remainder > 0)
|
||||
if (FLAGS_SET(flag, FORMAT_BYTES_ALWAYS_POINT) ||
|
||||
(FLAGS_SET(flag, FORMAT_BYTES_BELOW_POINT) && remainder > 0))
|
||||
(void) snprintf(buf, l,
|
||||
"%" PRIu64 ".%" PRIu64 "%s",
|
||||
t / table[i].factor,
|
||||
|
||||
Reference in New Issue
Block a user