Skip to content

Commit 04e30f3

Browse files
committed
use correct divisor
1 parent 3648f15 commit 04e30f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ fn to_string_decimal(bytes: u64, si_prefix: bool, f: &mut fmt::Formatter) -> fmt
248248
for (&size, &prefix) in unit_sizes.iter().zip(unit_prefix.iter()) {
249249
ideal_size = size;
250250
ideal_prefix = prefix;
251-
if size <= bytes && bytes / 1_000 < size {
251+
if size <= bytes && bytes / unit_sizes[0] < size {
252252
break;
253253
}
254254
}

0 commit comments

Comments
 (0)