#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

#267 in Value formatting

Download history 153/week @ 2024-01-01 150/week @ 2024-01-08 64/week @ 2024-01-15 184/week @ 2024-01-29 104/week @ 2024-02-05 270/week @ 2024-02-12 258/week @ 2024-02-19 177/week @ 2024-02-26 90/week @ 2024-03-04 117/week @ 2024-03-11 101/week @ 2024-03-18 127/week @ 2024-03-25 62/week @ 2024-04-01 153/week @ 2024-04-08 76/week @ 2024-04-15

421 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