Skip to content

Conversation

@SV-97
Copy link
Contributor

@SV-97 SV-97 commented Sep 30, 2022

Description

I just ran into a case where I wanted to format OrderedFloats in scientific notation using std::fmt::LowerExp and std::fmt::UpperExp. This adds delegate implementations for both of those traits.

Example:

use ordered_float::OrderedFloat;

fn main() {
    let n = OrderedFloat(10.2);
    println!("{:+.2e}", n); // prints "+1.02e1"
}

@mbrubeck mbrubeck merged commit f2900d6 into reem:master Oct 1, 2022
@mbrubeck
Copy link
Collaborator

mbrubeck commented Oct 1, 2022

Thanks! Published as version 3.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants