pub trait ParseNumeric {
// Required methods
fn parse_f64(&self) -> Option<f64>;
fn parse_u64(&self) -> Option<u64>;
}Expand description
Convenience trait for parsing string numeric fields to native types.
TradeStation returns most numeric values as JSON strings. This trait provides ergonomic parsing on any type with a string field.
§Example
use tradestation_api::market_data::ParseNumeric;
let value = "123.45";
assert_eq!(value.parse_f64(), Some(123.45));
assert_eq!("1000".parse_u64(), Some(1000));
assert_eq!("bad".parse_f64(), None);