Hi all. I am using CString::Format() to convert a double to string:
CString str;
str.Format("%f", 3.14); //The result is "3.14000000" ==> I want "3.14"
str.Format("%f", 202.141); //The result is "202.14100000" ==> I want "202.141"
I do not want the nonsignificant zeros. Is there a way to convert a double to string avoiding nonsignificant zeros?.
Thanks in advance,
William GS.
CString str;
str.Format("%f", 3.14); //The result is "3.14000000" ==> I want "3.14"
str.Format("%f", 202.141); //The result is "202.14100000" ==> I want "202.141"
I do not want the nonsignificant zeros. Is there a way to convert a double to string avoiding nonsignificant zeros?.
Thanks in advance,
William GS.