SFML community forums
Help => Graphics => Topic started by: ravenheart on September 15, 2008, 01:13:15 pm
-
hello i got an answer for this already in another topic but i couldnt handle it:
i have a game, and now i want to display the time it works,
getting the time is no problem nor generating the Text;
but how can i convert the float into a sf::String ?
-
but how can i convert the float into a sf::String ?
That is not part of the SFML library.
Just use the C++ class std::stringstream ;)
-
just tell me how to do it plz, i dont criticize sfml ^^
does somethin like
std::ostringstream out;
out << 3.1415926f;
std::string str(out.str());
work?
-
Yes, that should work. For further information about stringstreams and their methods, see here (http://www.cplusplus.com/reference/iostream/stringstream/).