Skip to content

from_str should support scientific notation #722

@blastrock

Description

@blastrock

Hi,

I have a case where numbers might be in classical notation, or in scientific notation for very small numbers. I understand that from_str handles the first case, and from_scientific the second. This forces me to write code like:

Decimal::from_str(fields[1])
                            .or_else(|_| Decimal::from_scientific(fields[1]))

It would help me if from_str just handles any notation.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions