I want to convert double-type value to CString, but the problem is that if value is 13, the CString will be "13.00000" (assume formatting is set to 5 decimal digits). I want CString to be "13" instead, or better yet "13.0" (if possible) to show user that the value is precise.
I could convert double-type value to char array and remove all necessary elements, and then convert the array to CString, but I'd like to write this more conveniently.
Is there any other way to do this? Maybe something like setpresicion for console output: http://www.cplusplus.com/reference/iostream/manipulators/setprecision/
@Null: I only gave number 13 as example. If the number is 13.4, then I want to format CString as "%.2f", if 13.45, then "%.3f" and so on... But I want to make all this as dynamic as possible.