This seems to fix issue #1876, and some of the superficial parts of issue #1375. The #fmt macro and the to_str functions will round, rather than truncate, floats as strings. Other issues remain, and I wrote more code here than intended, but the following should pass now. ``` fn x() { assert "3.1416" == #fmt["%.4f", 3.14159]; assert "3" == #fmt["%.0f", 3.14159]; assert "99" == #fmt["%.0f", 98.5]; assert "7.0000" == #fmt["%.4f", 6.999999999]; assert "3.141590000" == #fmt["%.9f", 3.14159]; } ```
This is a compiler and suite of associated libraries and documentation for the Rust programming language. See LICENSE.txt for terms of copyright and redistribution. See http://www.rust-lang.org for more information.
Description
Languages
Rust
95.7%
Shell
1%
RenderScript
0.7%
JavaScript
0.6%
Fluent
0.4%
Other
1.4%