I have a string that is in the format #########s###.## where #### is just a few numbers, and the second piece is usually a decimal, but not always.
I need to break the two number pieces apart, and set them as two doubles(or some other valid number type.
I can only use standard methods for this, as the server it's being run on only has standard modules.
I can currently grab the second piece using find and substr, but can't figure out how to get the first piece. I still haven't done anything that changes the second piece into a numerical type, but hopefully that is much easier.
here's what I have:
string symbol,pieces;
fin >> pieces; //pieces is a string of the type i mentioned #####s###.##
unsigned pos;
pos = pieces.find("s");
string capitals = pieces.substr(pos+1);
cout << "Price of stock " << symbol << " is " << capitals << endl;