-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Description
While not required by JSON spec (I believe), it might be the desired behaviour for the following tests to pass:
#[test]
fn trailing_zeroes_int() {
let n = Number::from_parts(true, 100, -1);
assert_eq!(format!("{}", n), "10");
}
#[test]
fn trailing_zeroes_fp() {
let n = Number::from_parts(true, 100, -3);
assert_eq!(format!("{}", n), "0.1");
}
#[test]
fn trailing_zeroes_small_fp() {
let n = Number::from_parts(true, 100, -302);
assert_eq!(format!("{}", n), "1e-300");
}
Currently they fail with "10.0" != "10", "0.100" != "0.1", and "1.00e-300" != "1e-300" respectively.
Metadata
Metadata
Assignees
Labels
No labels