Crates.io | convert_degrees |
lib.rs | convert_degrees |
version | 0.2.1 |
source | src |
created_at | 2023-04-04 22:04:57.599416 |
updated_at | 2023-04-20 14:55:10.323724 |
description | Converts degrees between Fahrenheit, Celsius, and Kelvin & degrees and radians |
homepage | |
repository | https://github.com/7ijme/convert_degrees |
max_upload_size | |
id | 830490 |
size | 13,017 |
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
}