bytesize icon indicating copy to clipboard operation
bytesize copied to clipboard

Unit measurements shouldn't convert from XiB to XB

Open mmstick opened this issue 7 years ago • 2 comments

let block_sectors = 1953458176;
let size = ByteSize::kib(block_sectors / 2);
println!("{}", size);

Expected Output:

931.48 GiB

Actual Output:

1000.2 GB

mmstick avatar Oct 24 '18 15:10 mmstick

Your request makes sense for me. In terms of implementation, we will be able to keep the unit as a kind of Enum and use the Enum type to represent the original input unit. But, it will cause the different behavior of the current library. So, let me think about more if there is a better option.

hyunsik avatar Oct 30 '18 20:10 hyunsik