you will have to format the string before it is displayed in the dialog box. If you are using MFC, then use CString's Format() method, for exaple
CString text;
float number = 12.123456;
text.Format("%.2f", number);
GetDialogItem(IDC_EDI1)->SetWindowText(text);
If you are not using MFC, then use standard C sprintf() function
char text[20];
float number = 12.123456;
sprintf(text,"%.2f", number);
GetDialogItem(IDC_EDI1)->SetWindowText(text);
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,957 posts
since Aug 2005