#byte #conversion #convert

big-bytes

Converts a number to the largest possible multiple of the byte unit

1 stable release

1.0.0 Oct 5, 2019

#261 in Value formatting

Download history 11/week @ 2023-11-28 138/week @ 2023-12-05 926/week @ 2023-12-12 357/week @ 2023-12-19 70/week @ 2023-12-26 168/week @ 2024-01-02 176/week @ 2024-01-09 20/week @ 2024-01-16 97/week @ 2024-01-23 104/week @ 2024-01-30 191/week @ 2024-02-06 253/week @ 2024-02-13 178/week @ 2024-02-20 231/week @ 2024-02-27 105/week @ 2024-03-05 72/week @ 2024-03-12

673 downloads per month

MIT/Apache

8KB
108 lines

big-bytes

GitHub Release Date

Converts a number to the largest possible multiple of the byte unit

Example

use big_bytes::BigByte;

let bytes = 2.456 * 1024_f32.powi(3);

assert_eq!("2.46 GiB", bytes.big_byte(2));

lib.rs:

Helps represent bytes with the largest possible mutliple of the byte unit.

Example

use big_bytes::BigByte;

let bytes = 2.456 * 1024_f32.powi(3);

assert_eq!("2.46 GiB", bytes.big_byte(2));

No runtime deps