在string类的对象中插入float类型(即格式化),该如何处理

在string类的对象中插入float类型(即格式化)
我是想把一个string类的对象中插入一个float类型.例如:
string   str;
float   mess   =   100.01;
以过一系列操作后str中存放的是字符串类型的100.01,即: "1 ", "0 ", "0 ", ". ", "0 ", "1 "

我用了一个办法,
float   mess   =   100.01;
CString   strTemp;
strTemp.Format( "%f ",mess);
string   str2(strTemp.GetBuffer(strTemp.GetLength()));
但输出的str2为:10001000

请问哪位高手指点一下.
谢谢!!!

------解决方案--------------------
float mess = 100.01;
CString strTemp;
strTemp.Format( "%.2f ",mess);
string str(strTemp.GetBuffer(strTemp.GetLength()));

我这样试了一下,是可以的啊
------解决方案--------------------
string str2(strTemp.GetBuffer(strTemp.GetLength()));
有必要这样写吗?

string str2(strTemp);就OK了
CString strTemp重载了operator LPCTSTR的

------解决方案--------------------
CString strTemp;
CString strNew= " ";
double mess = 100.01;

strTemp.Format( "%f ", mess);
for(int i=0; i <strTemp.GetLength(); i++)
{
strNew += strTemp[i];
if(i != strTemp.GetLength()-1)
strNew += ", ";
}
MessageBox(strNew);
------解决方案--------------------
float mess=100.01;
CString strtemp;
strtemp.Format( "%.2f ",mess);
CString str(strtemp.GetBuffer(strtemp.GetLength()));
输出都很正常