pub fn format_float(float: f64, precision: usize) -> String
Format a float with the given precision. Will use scientific notation if necessary.