particular double to CString to edit control
-
Hi all, I read a double (2.567656e-010) from file, then I convert it into CString and finally i put it in an edit control, but the value is too small so in the edit control i find 0.000000. Here you have the code i use, toremove is the variable linked to the edit control: double var=0; std::fstream f_load; f_load.open("C:\\best_pop.txt",std::ios::in); f_load>>var; CString tmp; tmp.Format("%lf",var); toremove.SetWindowText(tmp); What should i do to see 2.567656e-010 in the edit control ?
-
Hi all, I read a double (2.567656e-010) from file, then I convert it into CString and finally i put it in an edit control, but the value is too small so in the edit control i find 0.000000. Here you have the code i use, toremove is the variable linked to the edit control: double var=0; std::fstream f_load; f_load.open("C:\\best_pop.txt",std::ios::in); f_load>>var; CString tmp; tmp.Format("%lf",var); toremove.SetWindowText(tmp); What should i do to see 2.567656e-010 in the edit control ?
Use tmp.Format("%g", var); It should work.
-
Use tmp.Format("%g", var); It should work.
-
And also you can use of
wsprintf
WhiteSky