Skip to main content

Module string_to_float_optional

Module string_to_float_optional 

Source
Expand description

Custom deserialization module for handling strings as optional f64.

Used for fields like avg_price or leverage that may be empty or absent in API responses. Empty strings are treated as None, ensuring proper handling of optional numerical fields.

Functionsยง

deserialize
Deserializes a string to an Option<f64>, returning None for empty strings.
serialize
Serializes an Option<f64> as a string.