Both of these functions can be used to convert Integer to a String (using SFML data types). Both solutions should be cross-platform and compiler friendly.
#include <sstream>
using namespace std;
String toString(Int64 integer)
{
ostringstream os;
os << integer;
return os.str();
}
#include <string>using namespace std
;String toString
(Int32 integer
){ char numstr
[10]; // enough to hold all numbers up to 32-bits sprintf(numstr
, "%i", integer
); return numstr
;} As Laurent mentioned above, you could then do something like this:
Text myText;
Int32 myInteger = 1000;
myText.setString( toString(myInteger) );