forked from bcicen/go-units
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmass_units.go
45 lines (40 loc) · 1.14 KB
/
mass_units.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package units
var (
Mass = UnitOptionQuantity("mass")
// metric
Gram = NewUnit("gram", "g", Mass)
ExaGram = Exa(Gram)
PetaGram = Peta(Gram)
TeraGram = Tera(Gram)
GigaGram = Giga(Gram)
MegaGram = Mega(Gram)
KiloGram = Kilo(Gram)
HectoGram = Hecto(Gram)
DecaGram = Deca(Gram)
DeciGram = Deci(Gram)
CentiGram = Centi(Gram)
MilliGram = Milli(Gram)
MicroGram = Micro(Gram)
NanoGram = Nano(Gram)
PicoGram = Pico(Gram)
FemtoGram = Femto(Gram)
AttoGram = Atto(Gram)
// imperial
Grain = NewUnit("grain", "gr", Mass, BI)
Drachm = NewUnit("drachm", "dr", Mass, BI)
Ounce = NewUnit("ounce", "oz", Mass, BI)
Pound = NewUnit("pound", "lb", Mass, BI)
Stone = NewUnit("stone", "st", Mass, BI)
Ton = NewUnit("ton", "t", Mass, BI)
Slug = NewUnit("slug", "", Mass, BI)
)
func init() {
NewRatioConversion(Grain, Gram, 0.06479891)
NewRatioConversion(Drachm, Gram, 1.7718451953125)
NewRatioConversion(Ounce, Gram, 28.349523125)
NewRatioConversion(Pound, Gram, 453.59237)
NewRatioConversion(Stone, Gram, 6350.29318)
// 1 long ton
NewRatioConversion(Ton, Gram, 1016046.9088)
NewRatioConversion(Slug, Gram, 14593.90294)
}