VC实现

double dVal1 = 13.00;
double dVal2 = 13.13;
CString str1,str2;
str1.Format(_T("%.02f"), dVal1);
str2.Format(_T("%.02f"), dVal1);
str1.Replace(_T(".00"), _T(""));
str2.Replace(_T(".00"), _T(""));

QT实现

double dVal1 = 13.00;
double dVal2 = 13.13;
QString str1,str2;
str1.sprintf("%.02f", dVal1);
str2.sprintf("%.02f", dVal1);
str1.replace(".00", "");
str2.Replace(".00", "");