super-units

Crates.iosuper-units
lib.rssuper-units
version1.0.2
sourcesrc
created_at2020-07-06 02:12:58.443146
updated_at2020-07-08 06:11:57.282927
descriptionHandle byte units easily
homepagehttps://github.com/mota/super-units
repositoryhttps://github.com/mota/super-units
max_upload_size
id261789
size6,018
Pierre Wacrenier (mota)

documentation

README

Super Units Rust

Handle byte units easily

Usage

extern crate super_units;

use super_units::Amount;

fn main() {
    let amount = Amount::auto_detect(32_f64 * 1024_f64);
    println!("{}", amount); // 32.0 Kb
    println!("{}", amount.bytes()); // 32768.0
    println!("{}", amount.quantity()); // 32.0
    println!("{}", amount.unit()); // Kb
}
Commit count: 7

cargo fmt