File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ pub enum Unit {
92
92
Milliliter ,
93
93
/// Microliter
94
94
Microliter ,
95
+
96
+ /// Density
97
+ KilogramPerMeter2 ,
95
98
}
96
99
97
100
impl std:: fmt:: Display for Unit {
@@ -145,6 +148,9 @@ impl std::fmt::Display for Unit {
145
148
Self :: Centiliter => write ! ( f, "cl" ) ,
146
149
Self :: Liter => write ! ( f, "l" ) ,
147
150
Self :: Microliter => write ! ( f, "µl" ) ,
151
+
152
+ // Density
153
+ Self :: KilogramPerMeter2 => write ! ( f, "kg/m2" ) ,
148
154
}
149
155
}
150
156
}
@@ -181,6 +187,7 @@ impl Unit {
181
187
| Self :: Centiliter
182
188
| Self :: Milliliter
183
189
| Self :: Microliter => Type :: Volume ,
190
+ Self :: KilogramPerMeter2 => Type :: Density ,
184
191
}
185
192
}
186
193
/// Normalize value to mm, rad or gram
@@ -232,6 +239,9 @@ impl Unit {
232
239
Self :: Centiliter => x * 10_000.0_f64 ,
233
240
Self :: Milliliter => x * 1_000.0_f64 ,
234
241
Self :: Microliter => x * 1_000_000.0_f64 ,
242
+
243
+ // Densities
244
+ Self :: KilogramPerMeter2 => 1_f64 ,
235
245
}
236
246
}
237
247
}
You can’t perform that action at this time.
0 commit comments