المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : how to delete cstring



C++ Programming
04-10-2009, 04:30 PM
i don't know how i would delete CString.format(_T("%f"),a) a is type double..so 5 is 5,000000...now i would like to replace("delete") all the 0s from last index of string to index different from 0. for example:

5,0000 -> 5
5,1100 -> 5,11
5,0015300->5,00153

I have function for printing..so something must be done therehttp://www.barakasoft.com/script/Forums/Images/smiley_biggrin.gif...Here is also function:

void CcalcDlg::izpis(double a)
{
CString str;
str.Format(_T("%f"),a);
editbox.SetWindowText(str);
};


Plz help,
Thx