License: CC0 Crates.io Documentation Rust

Purpose

This rust library is intended to do some processing of length values.
It can parse strings with different units (m, km, mi, ft, ...) and converting them into other units.

Usage

To use length, first add this to your Cargo.toml:

toml [dependencies] length = "0.2"

Next, add this to your crate:

```rust extern crate length;

use length::{Length, Unit, MetricUnit::*};

fn main() { let fivemeter = Length::newstring("5m").unwrap(); asserteq!("5m", fivemeter.tooriginalstring()); asserteq!(5.0, fivemeter.value); asserteq!(Unit::Metric(Meter), fivemeter.unit);

let fivehundred_centimeter = five_meter.to(Unit::Metric(Centimeter));
assert_eq!(500.0, fivehundred_centimer.value);
assert_eq!(Unit::Metric(Centimeter), fivehundred_centimer.unit);

// ...

} ```

Documentation

For the latest documentation and examples, please go to https://docs.rs/length.

Miscellaneous

If you have suggestions or found an error, feel free to open an issue or create a pull request on github.