newnit/mass/
imperial.rs

1//! British Imperial units of mass
2//!
3//! This module contains predefined newtypes for units of mass as defined in the
4//! British Imperial system. The base unit is the metric kilogram.
5//!
6//! Additional aliases provided for commonly used alternative unit names.
7
8use super::Mass;
9use crate::{Unit, make_unit};
10use newnit_derive::{Mass, Unit};
11
12// Troy units (precious metals)
13// lb t
14make_unit!(TroyPound, 0.373_241_721_6, Mass);
15
16// oz t
17make_unit!(TroyOunce, 0.031_103_476_8, Mass);
18
19// dwt
20make_unit!(Pennyweight, 0.001_555_173_84, Mass);
21
22// gr
23make_unit!(Grain, 0.000_064_798_91, Mass);
24
25// Avoirdupois units
26
27// imperial long ton
28make_unit!(LongTon, 1_016.046_908_8, Mass);
29pub type ImperialTon = LongTon;
30
31// cwt
32make_unit!(Hundredweight, 50.802_345_44, Mass);
33
34// qr/ qrt
35make_unit!(Quarter, 12.700_586_36, Mass);
36
37// st
38make_unit!(Stone, 6.350_293_18, Mass);
39
40// lb
41make_unit!(Pound, 0.453_592_37, Mass);
42
43// oz
44make_unit!(Ounce, 0.028_349_523_1, Mass);
45
46// dr
47make_unit!(Drachm, 0.001_771_845_195_312_5, Mass);
48
49// Other
50
51// slug
52make_unit!(Slug, 14.593_902_94, Mass);