Kevin Cantu
a7359f5b3b
(float) fix some rounding errors when showing as str
...
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];
}
```
2012-06-02 16:38:18 -07:00
..
2012-05-18 10:05:24 -07:00
2012-05-22 14:10:32 -07:00
2012-05-29 16:22:17 -07:00
2012-05-22 14:59:15 -07:00
2012-05-22 14:59:15 -07:00
2012-05-24 05:19:44 -07:00
2012-05-31 15:07:09 -07:00
2012-05-16 12:44:54 -07:00
2012-05-18 14:32:38 -07:00
2012-05-18 14:32:37 -07:00
2012-05-16 12:44:54 -07:00
2012-05-18 14:32:38 -07:00
2012-05-16 12:44:54 -07:00
2012-05-30 11:26:15 -07:00
2012-05-16 12:44:54 -07:00
2012-05-16 12:44:54 -07:00
2012-05-18 14:32:37 -07:00
2012-05-25 14:37:35 -07:00
2012-05-18 19:07:19 -07:00
2012-06-01 18:27:38 -07:00
2012-06-01 18:27:30 -07:00
2012-05-26 02:28:00 -07:00
2012-05-24 06:49:40 -07:00
2012-05-26 02:28:00 -07:00
2012-05-26 02:28:00 -07:00
2012-05-26 02:28:00 -07:00
2012-05-26 02:28:00 -07:00
2012-05-26 02:28:00 -07:00
2012-05-26 02:28:00 -07:00
2012-06-01 21:28:55 -07:00
2012-05-30 11:04:12 -07:00
2012-05-15 20:35:57 -07:00
2012-05-24 15:06:56 -07:00
2012-05-18 15:59:00 -07:00
2012-05-18 14:28:39 -07:00
2012-05-18 20:00:50 -07:00
2012-05-22 14:10:32 -07:00
2012-05-15 20:35:57 -07:00
2012-05-18 10:38:18 -07:00
2012-05-18 20:00:50 -07:00
2012-05-15 20:35:57 -07:00
2012-05-26 02:28:00 -07:00
2012-05-29 16:50:21 -07:00
2012-05-29 17:05:17 -07:00
2012-05-29 14:40:35 -07:00
2012-05-31 12:20:26 -07:00
2012-05-24 09:52:03 -07:00
2012-05-24 09:52:03 -07:00
2012-05-24 09:52:16 -07:00
2012-05-24 09:52:03 -07:00
2012-05-21 09:37:34 -07:00
2012-04-06 20:38:23 +02:00
2012-05-26 02:28:00 -07:00
2012-05-26 02:28:00 -07:00
2012-05-26 02:28:00 -07:00
2012-05-21 09:37:34 -07:00
2012-05-26 02:28:00 -07:00
2012-05-26 02:28:00 -07:00
2012-06-02 10:08:04 -07:00
2012-06-02 10:08:04 -07:00
2012-05-28 17:03:44 -07:00
2012-05-24 05:19:44 -07:00
2012-06-01 09:26:48 -07:00
2012-06-01 09:26:48 -07:00
2012-05-22 16:35:10 -07:00
2012-05-15 20:35:57 -07:00
2012-05-22 22:12:18 -04:00
2012-05-22 22:12:18 -04:00
2012-06-01 20:40:34 -07:00
2012-05-26 02:28:00 -07:00
2012-05-30 11:04:12 -07:00
2012-05-26 02:28:00 -07:00
2012-06-01 20:40:34 -07:00
2012-06-01 20:40:35 -07:00
2012-05-22 18:03:26 -07:00
2012-05-22 14:59:15 -07:00
2012-05-30 16:02:48 -07:00
2012-05-18 20:00:50 -07:00
2012-06-02 16:38:18 -07:00
2012-05-18 10:05:25 -07:00
2012-05-26 02:28:00 -07:00
2012-06-01 20:40:34 -07:00
2012-05-24 09:52:03 -07:00
2012-06-01 20:40:34 -07:00
2012-05-21 09:37:34 -07:00
2012-05-23 15:46:43 -07:00
2012-06-01 20:40:34 -07:00
2012-05-26 02:28:00 -07:00
2012-06-01 20:40:34 -07:00
2012-06-01 20:40:34 -07:00