#include <string> #include <sstream> string floatToStr( float myFloat ) { std::ostringstream ss; ss << myFloat; std::string s = ss.str(); return s; }