2 releases

0.1.2 Jul 3, 2024
0.1.1 Apr 3, 2021

#1490 in Parser implementations

Download history 15/week @ 2024-10-25 44/week @ 2024-11-01 26/week @ 2024-11-08 34/week @ 2024-11-15 41/week @ 2024-11-22 23/week @ 2024-11-29 36/week @ 2024-12-06 26/week @ 2024-12-13 3/week @ 2024-12-20 21/week @ 2024-12-27 28/week @ 2025-01-03 12/week @ 2025-01-10 9/week @ 2025-01-17 14/week @ 2025-01-24 38/week @ 2025-01-31 21/week @ 2025-02-07

82 downloads per month
Used in pods-blitz

MIT/Apache

7KB
84 lines

fmtsize

Format memory sizes.

Usage

Import the trait and call the method.

use fmtsize::{Conventional, FmtSize};

println!("{}", 492_752_310_u64.fmt_size(Conventional)); // 469.93 MB

License

MIT or Apache 2.0. Pick whichever you like.


lib.rs:

fmtsize

fmtsize provides human-readable formatting for things like file sizes. It attempts to find the largest shorthand size possible for a given value, although it's limited to "gigabytes." Someday we may upgrade to terabytes. :)

println!("{}", 492_752_310_u64.fmt_size(Conventional)); // 469.93 MB

No runtime deps