Answers for "rust from floating point to money"

0

rust from floating point to money

fn money_string(amount: f64) -> String {
    format!("${:.2}", amount)
}

fn main() {
    println!("{}", money_string(123.45));
}
Posted by: Guest on March-13-2021

Code answers related to "rust from floating point to money"

Browse Popular Code Answers by Language