Skip to content

Commit f2900d6

Browse files
authored
Add scientific notation Display impls (#112)
1 parent 722b2a9 commit f2900d6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,20 @@ impl<T: Float + fmt::Display> fmt::Display for OrderedFloat<T> {
173173
}
174174
}
175175

176+
impl<T: Float + fmt::LowerExp> fmt::LowerExp for OrderedFloat<T> {
177+
#[inline]
178+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
179+
self.0.fmt(f)
180+
}
181+
}
182+
183+
impl<T: Float + fmt::UpperExp> fmt::UpperExp for OrderedFloat<T> {
184+
#[inline]
185+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
186+
self.0.fmt(f)
187+
}
188+
}
189+
176190
impl From<OrderedFloat<f32>> for f32 {
177191
#[inline]
178192
fn from(f: OrderedFloat<f32>) -> f32 {

0 commit comments

Comments
 (0)