Added units

pull/2/head
Mark 2023-06-12 22:56:04 -07:00
parent 76a686fb85
commit 5739c465ff
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
2 changed files with 163 additions and 27 deletions

View File

@ -241,6 +241,16 @@ base_value = "201.17"
base_units = [ { u = "Meter", p = 1} ]
[[unit]]
enum_name = "Rod"
print = "rod"
parse = ["rod", "rods"]
base_value_type = "exact"
base_value = "5.0292"
base_units = [ { u = "Meter", p = 1} ]
[[unit]]
enum_name = "Mile"
@ -568,6 +578,29 @@ base_units = [ { u = "Gram", p = 1}, { u = "Second", p = -2}, { u = "Meter", p =
[[unit]]
enum_name = "Calorie"
print = "cal"
parse = ["calorie", "calories"]
parse_with_prefix = "cal"
base_value_type = "exact"
base_value = "4184"
base_units = [ { u = "Gram", p = 1}, { u = "Second", p = -2}, { u = "Meter", p = 2} ]
[[unit]]
enum_name = "BTU"
print = "BTU"
parse = ["btu", "BTU"]
base_value_type = "exact"
base_value = "1055100"
base_units = [ { u = "Gram", p = 1}, { u = "Second", p = -2}, { u = "Meter", p = 2} ]
[[unit]]
enum_name = "Hertz"
print = "Hz"
@ -684,4 +717,115 @@ parse_with_prefix = "Wb"
base_value_type = "exact"
base_value = "1000"
base_units = [ { u = "Gram", p = 1}, { u = "Meter", p = 2}, { u = "Second", p = -2}, { u = "Ampere", p = -1} ]
base_units = [ { u = "Gram", p = 1}, { u = "Meter", p = 2}, { u = "Second", p = -2}, { u = "Ampere", p = -1} ]
# Mass and Force
[[unit]]
enum_name = "Tonne"
print = "t"
parse = ["t", "tonne", "tonnes", "ton", "tons"]
base_value_type = "exact"
base_value = "1000000"
base_units = [ { u = "Gram", p = 1} ]
[[unit]]
enum_name = "Ounce"
print = "oz"
parse = ["oz", "ounce", "ounces"]
base_value_type = "exact"
base_value = "28.349523125"
base_units = [ { u = "Gram", p = 1} ]
[[unit]]
enum_name = "Pound"
print = "lb"
parse = ["lb", "lbs", "pound", "pounds"]
base_value_type = "exact"
base_value = "453.59237"
base_units = [ { u = "Gram", p = 1} ]
[[unit]]
enum_name = "PoundForce"
print = "lbf"
parse = ["lbf", "poundforce"]
base_value_type = "exact"
base_value = "4448.2216152605"
base_units = [ { u = "Gram", p = 1}, { u = "Meter", p = 1}, { u = "Second", p = -2} ]
[[unit]]
enum_name = "Newton"
print = "N"
parse = ["newton", "newtons"]
parse_with_prefix = "N"
base_value_type = "exact"
base_value = "1000"
base_units = [ { u = "Gram", p = 1}, { u = "Meter", p = 1}, { u = "Second", p = -2} ]
# Misc Units
[[unit]]
enum_name = "Katal"
print = "kat"
parse = ["katal"]
parse_with_prefix = "kat"
base_value_type = "exact"
base_value = "1"
base_units = [ { u = "Mole", p = 1}, { u = "Second", p = -1} ]
# Radioactivity
[[unit]]
enum_name = "Becquerel"
print = "Bq"
parse = ["becquerel"]
parse_with_prefix = "Bq"
base_value_type = "exact"
base_value = "1"
base_units = [ { u = "Second", p = -1} ]
[[unit]]
enum_name = "Gray"
print = "Gy"
parse = ["gray"]
parse_with_prefix = "Gy"
base_value_type = "exact"
base_value = "1"
base_units = [ { u = "Meter", p = 2}, { u = "Second", p = -2} ]
[[unit]] # Not radian, radioactivity unit
enum_name = "Rad"
print = "rad"
parse_with_prefix = "rad"
base_value_type = "exact"
base_value = "0.01"
base_units = [ { u = "Meter", p = 2}, { u = "Second", p = -2} ]

View File

@ -6,29 +6,6 @@
| [DPI](https://en.wikipedia.org/wiki/Dots_per_inch) | `dpi` |
| [Dot](https://en.wikipedia.org/wiki/Dots_per_inch) | `dots`, `dot` |
| [Frame](https://en.wikipedia.org/wiki/Film_frame) | `frames`, `frame` |
flops
kWh abbreviations
| [Tonne](https://en.wikipedia.org/wiki/Tonne) | `tonnes`, `tonne`, `tons`, `ton`, `t` |
| [Ounce](https://en.wikipedia.org/wiki/Ounce) | `ounces`, `ounce`, `oz` |
| [Newton](https://en.wikipedia.org/wiki/Newton_(unit)) | `newton`, `N` |
| [Pound](https://en.wikipedia.org/wiki/Pound_(mass)) | `pounds`, `pound`, `lb` |
| [Pound-force](https://en.wikipedia.org/wiki/Pound_%28force%29) | `pound_force`, `lbf` |
| [Becquerel](https://en.wikipedia.org/wiki/Becquerel) | `becquerel`, `Bq` |
| [Bel](https://en.wikipedia.org/wiki/Decibel) | `bel` |
| [British thermal unit](https://en.wikipedia.org/wiki/British_thermal_unit) | `BTU` |
| [Calorie](https://en.wikipedia.org/wiki/Calorie) | `calories`, `calorie`, `cal` |
| [Degree](https://en.wikipedia.org/wiki/Degree_(angle)) | `degrees`, `degree`, `deg`, `°` |
| [Euro](https://en.wikipedia.org/wiki/Euro) | `euros`, `euro`, `EUR`, `€` |
| [Gray](https://en.wikipedia.org/wiki/Gray_(unit)) | `gray`, `Gy` |
| [Katal](https://en.wikipedia.org/wiki/Katal) | `katal`, `kat` |
| [Lumen](https://en.wikipedia.org/wiki/Lumen_(unit)) | `lumen`, `lm` |
| [Lux](https://en.wikipedia.org/wiki/Lux) | `lux`, `lx` |
| [PPI](https://en.wikipedia.org/wiki/Pixels_per_inch) | `ppi` |
| [Parts-per-million](https://en.wikipedia.org/wiki/Parts-per_notation) | `ppm` |
| [Parts-per-billion](https://en.wikipedia.org/wiki/Parts-per_notation) | `ppb` |
@ -37,6 +14,21 @@ kWh abbreviations
| [Percent](https://en.wikipedia.org/wiki/Parts-per_notation) | `percent`, `pct` |
| [Person](https://en.wiktionary.org/wiki/person) | `persons`, `person`, `people` |
| [Piece](https://en.wiktionary.org/wiki/piece) | `pieces`, `piece` |
| [RPM](https://en.wikipedia.org/wiki/RPM) | `RPM`, `rpm` |
| [Radian](https://en.wikipedia.org/wiki/Radian) | `radians`, `radian`, `rad` |
| [Rod](https://en.wikipedia.org/wiki/Rod_(unit)) | `rods`, `rod` |
| [RPM](https://en.wikipedia.org/wiki/RPM) | `RPM`, `rpm` |
| [Lumen](https://en.wikipedia.org/wiki/Lumen_(unit)) | `lumen`, `lm` |
| [Lux](https://en.wikipedia.org/wiki/Lux) | `lux`, `lx` |
| [Bel](https://en.wikipedia.org/wiki/Decibel) | `bel`
flops
kWh abbreviations
selective prefixes: tonne (k M G)
selective prefix: calorie
print units with powers, no division sign
| [Degree](https://en.wikipedia.org/wiki/Degree_(angle)) | `degrees`, `degree`, `deg`, `°` |
| [Radian](https://en.wikipedia.org/wiki/Radian) | `radians`, `radian`, `rad` |