Skip to main content

parse_price

Function parse_price 

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

Parses a decimal string into a [Price].

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 price.