Expand description
Print floats with many options:
use pretty_dtoa::{dtoa, FmtFloatConfig};
let config = FmtFloatConfig::default()
.max_decimal_digits(-3) // cut off at 3 decimals left of the decimal point
.truncate() // don't round
.force_no_e_notation() // don't use exponential notation
.add_point_zero(true); // add a .0 to the end of integer values
assert_eq!(dtoa(123123.0, config), "123000.0");
assert_eq!(dtoa(99999.0, config), "99000.0");Structs§
- FmtFloat
Config - Configuration for formatting floats into strings. Look at the associated methods for this type to see default values and specific examples.