#measure #unit #parser

ucum

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

1 unstable release

0.1.0 Aug 10, 2020

#62 in #measure

CECILL-B

97KB
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);

Implementation status

Syntax and semantics

Unit tables

Misc

  • Full crate documentation

No runtime deps