rust-decimal
rust-decimal copied to clipboard
from_str should support scientific notation
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.
I suspect this could fit nicely into the 2.0 branch.