trait

LowerExp formatting

Select the LowerExp trait using the matching format specifier. This creates text without changing the numeric value. Expected stdout (not executed): 1.25e2 Common mistake: Expecting the displayed text to change the stored value.

Formal Syntax & Structure

rust syntaxrust
{:e}

Working Example

Example Snippetrust
fn main() {    let n = 125.0f64;    println!("{:e}", n);}
Rust Reference