11/// Static type containing this package's pre-defined units
22enum DefaultUnits {
3- // MARK: If adding additional units to this list, add corresponding entries in the `Unit+DefaultUnits.swift` file
3+ // MARK: If adding units to this list, add corresponding entries in the `Unit+DefaultUnits.swift` & `Registry.swift` files
44
55 // MARK: Acceleration
66
@@ -986,12 +986,7 @@ enum DefaultUnits {
986986 dimension: [ . Length: 3 ] ,
987987 coefficient: 1000
988988 )
989- static let bushel = try ! DefinedUnit (
990- name: " bushel " ,
991- symbol: " bushel " ,
992- dimension: [ . Length: 3 ] ,
993- coefficient: 0.03523907
994- )
989+ // Liquid measures
995990 static let teaspoon = try ! DefinedUnit (
996991 name: " teaspoon " ,
997992 symbol: " tsp " ,
@@ -1022,12 +1017,44 @@ enum DefaultUnits {
10221017 dimension: [ . Length: 3 ] ,
10231018 coefficient: 473.176473e-6
10241019 )
1020+ static let quart = try ! DefinedUnit (
1021+ name: " quart " ,
1022+ symbol: " qt " ,
1023+ dimension: [ . Length: 3 ] ,
1024+ coefficient: 9.46352946e-4
1025+ )
10251026 static let gallon = try ! DefinedUnit (
10261027 name: " gallon " ,
10271028 symbol: " gal " ,
10281029 dimension: [ . Length: 3 ] ,
10291030 coefficient: 0.003785411784
10301031 )
1032+ // Dry measures: https://en.wikipedia.org/wiki/Dry_measure
1033+ static let dryPint : DefinedUnit = try ! DefinedUnit (
1034+ name: " dryPint " ,
1035+ symbol: " drypt " ,
1036+ dimension: [ . Length: 3 ] ,
1037+ coefficient: 5.506104713575e-4
1038+ )
1039+ static let dryQuart : DefinedUnit = try ! DefinedUnit (
1040+ name: " dryQuart " ,
1041+ symbol: " dryqt " ,
1042+ dimension: [ . Length: 3 ] ,
1043+ coefficient: 1.101220942715e-3
1044+ )
1045+ static let peck : DefinedUnit = try ! DefinedUnit (
1046+ name: " peck " ,
1047+ symbol: " pk " ,
1048+ dimension: [ . Length: 3 ] ,
1049+ coefficient: 8.80976754172e-3
1050+ )
1051+ static let bushel = try ! DefinedUnit (
1052+ name: " bushel " ,
1053+ symbol: " bu " ,
1054+ dimension: [ . Length: 3 ] ,
1055+ coefficient: 0.035239070167
1056+ )
1057+ // Imperial measures
10311058 static let imperialFluidOunce = try ! DefinedUnit (
10321059 name: " imperialFluidOunce " ,
10331060 symbol: " ifl_oz " ,
@@ -1046,12 +1073,24 @@ enum DefaultUnits {
10461073 dimension: [ . Length: 3 ] ,
10471074 coefficient: 568.26125e-6
10481075 )
1076+ static let imperialQuart = try ! DefinedUnit (
1077+ name: " imperialQuart " ,
1078+ symbol: " iqt " ,
1079+ dimension: [ . Length: 3 ] ,
1080+ coefficient: 1.1365225e-3
1081+ )
10491082 static let imperialGallon = try ! DefinedUnit (
10501083 name: " imperialGallon " ,
10511084 symbol: " igal " ,
10521085 dimension: [ . Length: 3 ] ,
10531086 coefficient: 0.00454609
10541087 )
1088+ static let imperialPeck : DefinedUnit = try ! DefinedUnit (
1089+ name: " imperialPeck " ,
1090+ symbol: " ipk " ,
1091+ dimension: [ . Length: 3 ] ,
1092+ coefficient: 9.09218e-3
1093+ )
10551094 static let metricCup = try ! DefinedUnit (
10561095 name: " metricCup " ,
10571096 symbol: " mcup " ,
0 commit comments