File tree 2 files changed +4
-2
lines changed
nautilus_core/model/src/types
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -117,8 +117,9 @@ impl FromStr for Price {
117
117
118
118
fn from_str ( input : & str ) -> Result < Self , Self :: Err > {
119
119
let float_from_input = input
120
+ . replace ( '_' , "" )
120
121
. parse :: < f64 > ( )
121
- . map_err ( |err| format ! ( "Cannot parse `input` string '{input}' as f64: {err}" ) ) ?;
122
+ . map_err ( |err| format ! ( "Error parsing `input` string '{input}' as f64: {err}" ) ) ?;
122
123
123
124
Self :: new ( float_from_input, precision_from_str ( input) )
124
125
. map_err ( |e : anyhow:: Error | e. to_string ( ) )
Original file line number Diff line number Diff line change @@ -110,8 +110,9 @@ impl FromStr for Quantity {
110
110
111
111
fn from_str ( input : & str ) -> Result < Self , Self :: Err > {
112
112
let float_from_input = input
113
+ . replace ( '_' , "" )
113
114
. parse :: < f64 > ( )
114
- . map_err ( |e| format ! ( "Cannot parse `input` string '{input}' as f64: {e}" ) ) ?;
115
+ . map_err ( |e| format ! ( "Error parsing `input` string '{input}' as f64: {e}" ) ) ?;
115
116
116
117
Self :: new ( float_from_input, precision_from_str ( input) )
117
118
. map_err ( |e : anyhow:: Error | e. to_string ( ) )
You can’t perform that action at this time.
0 commit comments