[Resolved]From vector of string to float

Hello!

All is in the title! I have :

vector<string> data = ofSplitString(dataval, ',');
x = data[0];
y = data[1];
z = data[2];

and I would like to put the data in x,y and z (which are strings) into float variables.
I’ve achieved to do it with int but I fail with float.

Thanks for your help!

You can use ofToFloat
http://www.openframeworks.cc/documentation/utils/ofUtils.html#show_ofToFloat

x = ofToFloat(data[0]);
…..

You save my life too often man! Thanks again!