Skip to main content

parse_quantity

Function parse_quantity 

Source
pub fn parse_quantity(value: &str, field_name: &str) -> Result<Quantity>
Expand description

Parses a decimal string into a [Quantity].

Normalizes the decimal to strip trailing zeros and clamps precision to [FIXED_PRECISION] to prevent panics from venue values with excessive decimal places.

ยงErrors

Returns an error if the string cannot be parsed into a valid quantity.