1 unstable release
0.1.0 | Aug 10, 2020 |
---|
#62 in #measure
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
- Parser for UCUM complex units
- Semantics of standard units
- Semantics of special units
- Semantics of arbitrary units
Unit tables
- Table 1: prefix symbols
- Table 2: base units
- Table 3: dimensionless units
- Table 4: SI units
- Table 5: Other units from ISO 1000, ISO 2955, and some from ANSI X3.50
- Table 6: Natural units
- Table 7: CGS units
- Table 8: International customary units
- Table 9: Older U.S. “survey” lengths (also called "statute" lengths)
- Table 10: British Imperial lengths
- Table 11: U.S. volumes including so called “dry measures”
- Table 12: British Imperial volumes
- Table 13: Avoirdupois weights
- Table 14: Troy weights
- Table 15: Apothecaries' weights
- Table 16: Units used in typesetting
- Table 17: Other Units for Heat and Temperature
- Table 18: Units Used Predominantly in Clinical Medicine
- Table 19: Units used in Chemical and Biomedical Laboratories
- Table 20: Levels
- Table 21: Miscellaneous Units
- Table 22: Units used in Information Science and Technology
- Table 23: The special prefix symbols for powers of 2
Misc
- Full crate documentation