[][src]Crate human_bytes

human_bytes

human_bytes is a Rust crate to convert bytes into human-readable values.

Example

use human_bytes::human_bytes;

assert_eq!(human_bytes(563_200_u32), "550 KB".to_string());
// or
assert_eq!(human_bytes(563_200_u64 as f64), "550 KB".to_string());
// ________________________________/
// |
// | Needed only when you're using `u64` values,
// | because `f64` doesn't implement `std::convert::From<u64>`

For more info, check the README.md

Functions

human_bytes

Performs the conversion