Closed
Description
I tried this code:
println!("{:.*e}", 0, 25);
println!("{:.*e}", 0, 25.0);
I expected to see this happen:
The output should be the same regardless if I'm formatting an integer or a float, in this case most likely 3e1
.
Instead, this happened:
3.e1
2e1
Happens in both latest stable and nightly.
EDIT: I'm suspecting this is actually two separate bugs in both the integer and float implementation - the integer result contains a .
which should not be there, and the float gets rounded down to 2
despite 25.1
rounding to 3e1
- which is the result I would expect for 25.0
as well.