1 unstable release

0.1.1 Apr 3, 2021

#288 in Value formatting

Download history 15/week @ 2024-01-22 2/week @ 2024-02-12 23/week @ 2024-02-19 41/week @ 2024-02-26 9/week @ 2024-03-04 14/week @ 2024-03-11 3/week @ 2024-03-18 15/week @ 2024-03-25 31/week @ 2024-04-01

64 downloads per month

MIT/Apache

7KB
84 lines

fmtsize

Format memory sizes.

Usage

Import the trait and call the method.

use fmtsize::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