I'm looking for a function that can retrieve numeric values from a formatted string.
MQL has functions like printf(), StringFormat, etc, to format values to string, but I just can not find a "formatted input" function, i.e., like C's "sscanf()".
Anyone has a clue? Thanks!
The most simple way is a typecast or use StringToDouble().
But you need to be aware of the way that strings get typecasted into numbers i.e.
Forum on trading, automated trading systems and testing trading strategies
Issue with StringToDouble()
honest_knave, 2017.02.25 11:30
StringToDouble (and StrToDouble) will start from the left-most character.
Not documented (to my knowledge)
If you're looking to extract certain numbers like sscanf does, that will definitely require your own function.
You may find some ideas in here or here. It will depend on how you expect your string to be formatted, and what you want to extract.