MinnisotaFreezing
Programmer
Here is my question:
I need to do some manipulation with doubles, and when the manipulation is done, I want to store the data with only 2 significant digits. That is, 1.4569807 would be stored as 1.4600 or 1.4600000000 to whatever the double is.
To be more specific, I am using DDX to transfer my data through ODBC drivers, so I can't use fprintf("%.2f", data);
I can do this:
CString string.Format("%.2f", data);
data = atof(string);
but that seems a little silly.
Any suggestions?
I need to do some manipulation with doubles, and when the manipulation is done, I want to store the data with only 2 significant digits. That is, 1.4569807 would be stored as 1.4600 or 1.4600000000 to whatever the double is.
To be more specific, I am using DDX to transfer my data through ODBC drivers, so I can't use fprintf("%.2f", data);
I can do this:
CString string.Format("%.2f", data);
data = atof(string);
but that seems a little silly.
Any suggestions?