Skip to content

dustbyte/super-units

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

Handle byte units easily

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages