Input:
double d = 0.005;
CString strTemp;
strTemp.Format("%.0e",d);
Output : “5e-003”
But if I want “5e-03” then
Input:
// Enable two-digit exponent format
unsigned int old_exponent_format;
old_exponent_format = _set_output_format(_TWO_DIGIT_EXPONENT);
double d = 0.005;
CString strTemp;
strTemp.Format("%.0e",d);
Output : “5e-03”

No comments:
Post a Comment