#unit #measure #parser #ucum

ucum

Implementation of the Unified Code for Units of Measures (UCUM)

1 unstable release

0.1.0 Aug 10, 2020

#11 in #measure

Download history 29/week @ 2022-06-07 28/week @ 2022-06-14 77/week @ 2022-06-21 68/week @ 2022-06-28 84/week @ 2022-07-05 197/week @ 2022-07-12 167/week @ 2022-07-19 85/week @ 2022-07-26 113/week @ 2022-08-02 74/week @ 2022-08-09 72/week @ 2022-08-16 139/week @ 2022-08-23 101/week @ 2022-08-30 225/week @ 2022-09-06 368/week @ 2022-09-13 203/week @ 2022-09-20

944 downloads per month

CECILL-B

96KB
2.5K SLoC

Rust implementation of UCUM

UCUM is the Unified Code for Units of Measure.

This crate is a partial implementation of the UCUM specification.

See crate documentation for more detail.


lib.rs:

UCUM is the Unified Code for Units of Measure.

This crate is a (partial) implementation of the revision 442 of the UCUM specification.

Quick start

use ucum::prelude::*;

let system = UnitSystem::<f64>::default();
let q1 = system.parse("35.5 km/h")?;
let q2 = system.parse("1.1e1 m.s-1")?;
assert!(q1 < q2);
assert!(2*q1 > q2);
# Ok::<(), Box<dyn std::error::Error>>(())

Implementation status

Syntax and semantics

Unit tables

Misc

  • Full crate documentation

No runtime deps