-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Description
Formatting 0e15 leads to 0000000000000000, not 0 as expected.
I assume there is something wrong in the logic to add trailing zeros when there isn't a significant digit.
Trying to have a look.
Adding this test case fails:
mod dec_0e15 {
use super::*;
fn test_input() -> BigDecimal {
"0e15".parse().unwrap()
}
impl_case!(fmt_default: "{}" => "0");
impl_case!(fmt_d0: "{:.0}" => "0");
impl_case!(fmt_d1: "{:.1}" => "0.0");
}
---- impl_fmt::test::fmt_options::dec_0e15::fmt_d0 stdout ----
thread 'impl_fmt::test::fmt_options::dec_0e15::fmt_d0' panicked at src/impl_fmt.rs:1193:13:
assertion `left == right` failed
left: "0000000000000000"
right: "0"
---- impl_fmt::test::fmt_options::dec_0e15::fmt_d1 stdout ----
thread 'impl_fmt::test::fmt_options::dec_0e15::fmt_d1' panicked at src/impl_fmt.rs:1194:13:
assertion `left == right` failed
left: "0000000000000000.0"
right: "0.0"
---- impl_fmt::test::fmt_options::dec_0e15::fmt_default stdout ----
thread 'impl_fmt::test::fmt_options::dec_0e15::fmt_default' panicked at src/impl_fmt.rs:1192:13:
assertion `left == right` failed
left: "0000000000000000"
right: "0"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels