- Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
When whole numbers other than 0 with decimal places are parsed and then converted back to string they maintain their decimal point unless than number is 0 in which case it gets stripped. it would be useful if 0 also retained its decimal place when being converted back to a string.
#[test] fn test_consistent_output_types() { let input = r#"{"one":1.0,"zero":0.0,"one_int":1,"zero_int":0}"#; let parsed = json::parse(input).unwrap(); let output = parsed.to_string(); assert_eq!(input, output); } assertion `left == right` failed left: "{\"one\":1.0,\"zero\":0.0,\"one_int\":1,\"zero_int\":0}" right: "{\"one\":1.0,\"zero\":0,\"one_int\":1,\"zero_int\":0}" Metadata
Metadata
Assignees
Labels
No labels