Skip to content

7ijme/convert_degrees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert Degrees

With this small project you can convert between Celsius, Fahrenheit and Kelvin & Degrees and radians very easily.


Bin Installation:

cargo install convert_degrees --features bin

Usage:

deg [-f from] [-t to] <degrees> 

Available options:
    -f, --from <from>  From which unit to convert -- Can be celsius(c), fahrenheit(f) kelvin(k),
                       degrees(d) or radians(r)
    -t, --to <to>      To which unit to convert   -- Can be celsius(c), fahrenheit(f) kelvin(k),
                       degrees(d) or radians(r)
    -h, --help         Prints help information

Library installation

cargo add convert_degrees
use convert_degrees::{ConvertTemperatures, DegreeUnit, Temperature};

fn main() {
    let celcius = Temperature {
        value: 12f64,
        unit: DegreeUnit::Celsius,
    };

    let fahrenheit = celcius.to(DegreeUnit::Fahrenheit);

    println!("{} is the same as {}", celcius, fahrenheit);
    // output: 12°C is the same as 53.6°F
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages