Serialize float number and truncate to certain precision
Serialize float number and truncate to certain precision in Rust.