pub fn format_number(num: f32, precision: usize) -> String
Formats num to the given precision only when necessary. If the rounded value has no fractional part, it is returned without decimals.
num