Skip to main content

parse

Function parse 

Source
pub fn parse(value: &str) -> Result<Decimal, Error>
Expand description

Parses a decimal or scientific string without rounding its numeric value.

Accepts signs, decimal points, and digit separators supported by rust_decimal. Scientific input is normalized. Plain input drops redundant trailing zeros only when needed to fit Decimal’s mantissa or scale. Scientific exponents must fit i64.

§Errors

Returns an error if:

  • The input is not a valid decimal or scientific string.
  • The value exceeds Decimal’s exact mantissa or scale bounds.