measurement-units

Crates.iomeasurement-units
lib.rsmeasurement-units
version0.1.1
sourcesrc
created_at2022-01-16 16:38:29.159317
updated_at2022-01-16 16:44:05.337845
descriptionRust library for basic measurements units conversion such as length, mass, time, volume, percents.
homepagehttps://github.com/dobromyslov/measurement-units-rs#readme
repositoryhttps://github.com/dobromyslov/measurement-units-rs
max_upload_size
id514991
size9,908
Viacheslav Dobromyslov (dobromyslov)

documentation

README

measurement-units

Rust library for basic measurements units conversion such as length, mass, time, volume, percents.

Install

# Cargo.toml
[dependencies]
measurement-units = "0.1.1"

Usage

use measurement_units::{convert, Length};
let length_in_centimeters = convert(&1.0, &Length::M, &Length::CM, &Option::None);
assert_eq!(100.0, length_in_centimeters);

let length_in_meters = convert(&99.5, &Length::CM, &Length::M, &Some(0_u32));
assert_eq!(1.0, length_in_meters);

License

MIT (c) 2022 Viacheslav Dobromyslov <viacheslav@dobromyslov.ru>

Commit count: 5

cargo fmt