CString::Format("%lf"..精度太高了
有一函数,根据用户传入的值,来求解它的长度
比如:320.10 ,长度为6
257.21 长度为6 我是用CString 来求解
int Length( double val)
{
CString str;
str.Format("%lf",val); // 导致 长度错误
return str.GetLength();
}
根源在于 double 给我添加了很多小数点
当然有其他办法求解,我觉得CString 比较方便,没想到 精度 捣乱
...全文


