-
Notifications
You must be signed in to change notification settings - Fork 0
/
units.toml
264 lines (241 loc) · 7.56 KB
/
units.toml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# All units specified in the conversion table MUST ALSO be declared in this unit table!
# Compound units do NOT need to be declared, but their components do.
# For example, km/h does not need to be declared but "km" and "h" do.
[units]
# Format: plural_form = ["singular form", "alias 1", "alias 2", ...]
# The plural form must be quoted if it contains spaces, dots, or other special characters
# Time
nanoseconds = ["nanosecond", "ns", "nsec"]
microseconds = ["microsecond", "µs", "µsec", "us", "usec"]
milliseconds = ["millisecond", "ms", "msec"]
seconds = ["second", "s", "sec"]
minutes = ["minute", "min"]
hours = ["hour", "h", "hr", "hrs"]
days = ["day", "d"]
weeks = ["week", "wk"]
years = ["year", "y", "yr", "yrs"]
months = ["month", "mo"]
decades = ["decade"]
centuries = ["century"]
millennia = ["millennium", "kiloyear"]
# Data size in bits (both SI and binary)
bits = ["bit", "b"]
kilobits = ["kilobit", "Kb", "kb", "kbit"]
kibibits = ["kibibit", "Kib", "kib"]
megabits = ["megabit", "Mb", "mbit"]
mebibits = ["mebibit", "Mib"]
gigabits = ["gigabit", "Gb", "gbit"]
gibibits = ["gibibit", "Gib"]
terabits = ["terabit", "Tb", "tbit"]
tebibits = ["tebibit", "Tib"]
petabits = ["petabit", "Pb", "pbit"]
pebibits = ["pebibit", "Pib"]
# Data size in bytes (both SI and binary)
bytes = ["byte", "B"]
kilobytes = ["kilobyte", "KB", "kB"]
kibibytes = ["kibibyte", "KiB", "kiB"]
megabytes = ["megabyte", "MB"]
mebibytes = ["mebibyte", "MiB"]
gigabytes = ["gigabyte", "GB"]
gibibytes = ["gibibyte", "GiB"]
terabytes = ["terabyte", "TB"]
tebibytes = ["tebibyte", "TiB"]
petabytes = ["petabyte", "PB"]
pebibytes = ["pebibyte", "PiB"]
# Energy
millijoules = ["millijoule", "mJ"]
joules = ["joule", "J"]
kilojoules = ["kilojoule", "kJ"]
electronvolts = ["electronvolt", "electron-volt", "electron volt", "electron-volts", "electron volts", "eV"]
# Power
milliwatts = ["milliwatt", "mW"]
watts = ["watt", "W"]
kilowatts = ["kilowatt", "kW"]
megawatts = ["megawatt", "MW"]
gigawatts = ["gigawatt", "GW"]
# Charge
microcoulombs = ["microcoulomb", "µC", "uC"]
millicoulombs = ["millicoulomb", "mC"]
coulombs = ["coulomb", "C"]
# Voltage
microvolts = ["microvolt", "µV", "uV"]
millivolts = ["millivolt", "mV"]
volts = ["volt", "V"]
kilovolts = ["kilovolt", "kV"]
# Current
microamperes = ["microampere", "µA", "uA"]
milliamperes = ["milliampere", "mA"]
amperes = ["ampere", "A"]
# Frequency
hertz = ["hertz", "Hz"]
kilohertz = ["kilohertz", "KHz", "kHz"]
megahertz = ["megahertz", "MHz"]
gigahertz = ["gigahertz", "GHz"]
terahertz = ["terahertz", "THz"]
# Length (metric)
nanometers = ["nanometer", "nm"]
micrometers = ["micrometer", "µm", "um"]
millimeters = ["millimeter", "mm"]
centimeters = ["centimeter", "cm"]
meters = ["meter", "m"]
kilometers = ["kilometer", "km"]
# Length (imperial)
inches = ["inch", "in", '"']
feet = ["foot", "ft"]
yards = ["yard", "yd"]
miles = ["mile", "mi"]
"nautical miles" = ["nautical mile", "NM"]
# Mass (metric)
micrograms = ["microgram", "µg", "ug"]
milligrams = ["milligram", "mg"]
grams = ["gram", "g"]
kilograms = ["kilogram", "kg"]
"metric tons" = ["metric ton", "mt", "Mt"]
# Weight (imperial)
ounces = ["ounce", "oz"]
pounds = ["pound", "lb", "lbs"]
stones = ["stone", "st"]
tons = ["ton", "T"]
# Pressure
pascals = ["pascal", "Pa"]
bars = ["bar", "Bar"]
torr = ["torr", "Torr"]
atmospheres = ["atmosphere", "atm"]
# Volume (metric)
milliliters = ["milliliter", "mL"]
liters = ["liter", "L"]
"cubic meters" = ["cubic meter", "m³", "m3"]
# Volume (US imperial)
"cubic inches" = ["cubic inch", "in³", "in3"]
"fluid ounces" = ["fluid ounce", "fl oz.", "fl oz"]
"cubic feet" = ["cubic foot", "ft³", "ft3"]
cups = ["cup", "c"]
teaspoons = ["teaspoon", "tsp", "t"]
pints = ["pint", "pt"]
quarts = ["quart", "qt"]
gallons = ["gallon", "gal"]
tablespoons = ["tablespoon", "Tbl", "Tbsp"]
# Particles
moles = ["mole", "mol"]
molecules = ["molecule"]
[compound_aliases]
# This table is for aliasing compound units.
# For example, "miles per hour" is commonly known as "mph", which doesn't follow
# the standard "X per X" or "X/X" notation. As a result, it needs to be explicitly
# aliased here.
mph = "mi/h"
[conversions]
# Format: "[from amount] [from unit]" = '[to amount] [to unit]"
# Any unit aliases defined in the table above can be used here.
# Scientific notation in the form 6.23e23 is supported (e-X works for negative numbers)
# Underscores may be used as separators (NOT commas or dots) to make large numbers more readable
# Example entries demonstrating all the above criteria:
# "1 mole" = "6.0221409e+23 molecules"
# "1 mol" = "602_214_090_000_000_006_225_920 molecules"
# Time
"1 microsecond" = "1000 nanoseconds"
"1 millisecond" = "1000 microseconds"
"1 second" = "1000 milliseconds"
"60 seconds" = "1 minute"
"60 minutes" = "1 hour"
"24 hours" = "1 day"
"7 days" = "1 week"
"365.25 days" = "1 year"
"30.4167 weeks" = "1 month"
"52 weeks" = "1 year"
"12 months" = "1 year"
"10 years" = "1 decade"
"100 years" = "1 century"
"1000 years" = "1 millennium"
# Data size in bits (both SI and binary)
"1000 bits" = "1 kilobit"
"1024 bits" = "1 kibibit"
"1000 kilobits" = "1 megabit"
"1024 kibibits" = "1 mebibit"
"1000 megabits" = "1 gigabit"
"1024 mebibits" = "1 gibibit"
"1000 gigabits" = "1 terabit"
"1024 gibibits" = "1 tebibit"
"1000 terabits" = "1 petabit"
"1024 petabits" = "1 pebibit"
# Data size in bytes (both SI and binary)
"8 bits" = "1 byte"
"1000 bytes" = "1 kilobyte"
"1024 bytes" = "1 kibibyte"
"1000 kilobytes" = "1 megabyte"
"1024 kibibytes" = "1 mebibyte"
"1000 megabytes" = "1 gigabyte"
"1024 mebibytes" = "1 gibibyte"
"1000 gigabytes" = "1 terabyte"
"1024 gibibytes" = "1 tebibyte"
"1000 terabytes" = "1 petabyte"
"1024 petabytes" = "1 pebibyte"
# Energy
"1000 millijoules" = "1 joule"
"1000 joules" = "1 kilojoule"
"1 joule" = "6_241_509_744_511_500_288 electronvolts"
# Power
"1000 milliwatts" = "1 watt"
"1000 watts" = "1 kilowatt"
"1000 kilowatts" = "1 megawatt"
"1000 megawatts" = "1 gigawatt"
"1 watt" = "1 joule per second"
# Voltage
"1000 microvolts" = "1 millivolt"
"1000 millivolts" = "1 volt"
"1000 volts" = "1 kilovolt"
# Current
"1000 microamperes" = "1 milliampere"
"1000 milliamperes" = "1 ampere"
# Charge
"1000 microcoulombs" = "1 millicoulomb"
"1000 millicoulombs" = "1 coulomb"
"1 ampere" = "1 coulomb per second"
# Frequency
"1000 hertz" = "1 kilohertz"
"1000 kilohertz" = "1 megahertz"
"1000 megahertz" = "1 gigahertz"
"1000 gigahertz" = "1 terahertz"
# Length (metric)
"1000 nanometers" = "1 micrometer"
"1000 micrometers" = "1 millimeter"
"1000 millimeters" = "1 meter"
"100 centimeters" = "1 meter"
"1000 meters" = "1 kilometer"
# Length (imperial)
"12 inches" = "1 foot"
"3 feet" = "1 yard"
"5280 feet" = "1 mile"
"6076 feet" = "1 nautical mile"
# Length (cross-system)
"1 inch" = "2.54 centimeters"
# Mass (metric)
"1000 micrograms" = "1 milligram"
"1000 milligrams" = "1 gram"
"1000 grams" = "1 kilogram"
"1000 kilograms" = "1 metric ton"
# Weight (imperial)
"16 ounces" = "1 pound"
"14 pounds" = "1 stone"
"2000 pounds" = "1 ton"
# Mass/weight (cross-system)
"28.3495 grams" = "1 ounce"
# Pressure
"100000 pascals" = "1 bar"
"133.322 pascals" = "1 torr"
"760 torr" = "1 atmosphere"
# Volume (metric)
"1000 milliliters" = "1 liter"
"1000 liters" = "1 cubic meter"
# Volume (US imperial)
"1 cubic inch" = "0.554113 fluid ounces"
"1728 cubic inches" = "1 cubic foot"
"240 milliliters" = "1 cup" # also cross-system
"48.6922 teaspoons" = "1 cup"
"16 fluid ounces" = "1 pint"
"2 pints" = "1 quart"
"4 quarts" = "1 gallon"
"256 tablespoons" = "1 gallon"
"3 teaspoons" = "1 tablespoon"
# Particles
"1 mole" = "6.0221409e+23 molecules"