CString str;
str.Format("%f", 1.2345);
AfxMessageBox(str);
float f= 123.4121;
char szBufffer[10];
sprintf(szBuffer, "%f", f);
CString str;
str.Format("%f", 1.2345);
AfxMessageBox(str);
float f= 123.4121;
char szBufffer[10];
sprintf(szBuffer, "%f", f);
转载于:https://www.cnblogs.com/Yogurshine/p/3257564.html