//暴力删除 void DeleteNoUseNum(CString& csTemp) { int Ret = csTemp.Find(_T("."), 0); if (Ret > 0) { for (int i = Ret + 1; i < csTemp.GetLength(); i++) { char str = csTemp.GetAt(i); if (str > 48) { if ((i + 1) < csTemp.GetLength()) { if (csTemp.GetAt(i + 1) == 48) { csTemp.Delete(i + 1, csTemp.GetLength()); return; } } else { return; } } } csTemp.Delete(Ret, csTemp.GetLength()); return; } return; } //删除小数点后多余零 void TrimRightZero(CString& str) { if (-1 != str.ReverseFind(_T('.'))) { str.TrimRight(_T('0')); str.TrimRight(_T('.')); } }