📜  rust 小数点后 2 位 - Rust 代码示例

📅  最后修改于: 2022-03-11 14:49:25.409000             🧑  作者: Mango

代码示例1
fn main() {
    let x = 12.34567_f64;
    let y = (x * 100.0).round() / 100.0;

    println!("{:.5} {:.5}", x, y);
}

// There is no built in method