Instead of this function, use boost::format.

In any file needing it, add the following include to the top of the file:
#include <boost/format.hpp>

Then use it like this: "str(boost::format("%d") % number)".