Skip to content

Regression: scientific notation in BigDecimal::to_string()  #135

@findepi

Description

@findepi

to_scientific_notation() is supposed to produce scientific notation, to_string() used to (and IMO should continue) to produce decimal form without scientific notation.

The following test

#[test]
fn test() {
    let big_decimal = BigDecimal::from_str("0.00000000000000000000000000000000000001").unwrap()
        .normalized();
    assert_eq!(big_decimal.to_string(), "0.00000000000000000000000000000000000001");
}

Used to pass with v 0.4.2 and no longer passes with 0.4.3:

assertion `left == right` failed
  left: "1E-38"
 right: "0.00000000000000000000000000000000000001"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions