double b = a / 100000;
b = (int) b;
b *= 100000;
How the above C code is converted to Rust? Especially the line #2 that rounds the number.
This is an example of round in Rust. You have to write numeric constants right the type they are: for example if d is f64 and you want to multiply it by 10 the right convention is to write: d * 10.0 instead of: d * 10
and explicitly define the type of your variable to make the round function available in this cases.
let a = 2e50;
let mut b : f64 = a / 100000.0;
b = b.round();
println!("{}", b);