Skip to main content

formatted_float

Function formatted_float 

Source
pub fn formatted_float<F: Float + Display>(f: F, dec: usize) -> String
Expand description

Converts a float type to a String, rounds it and trims trailing zeros. The sign is displayed only for negative values. See formatted_float_signed.

  • dec: The number of decimals to use when rounding the number.