数据类型转换的有关问题(急)
数据类型转换的问题(急!!!)
CString str;
str.Format( "%.2f ",m_pSet-> m_YL1N);
m_YL1N.SetWindowText(str);
m_YL1N在数据库里是float型 8位
在数据库里m_YL1N=5时 显示的是0.00
在数据库里m_YL1N为空时 显示的是0.00(我想让他为空)
为什么转换会错误呢?
------解决方案--------------------
因为m_YL1N是LONG型的,所以用 m_YL1N.SetWindowText(str);结果不能为空
用GetDlgItem(IDC)-> SetWindowText(_T( " "));设置为空
CString str;
str.Format( "%.2f ",m_pSet-> m_YL1N);
m_YL1N.SetWindowText(str);
m_YL1N在数据库里是float型 8位
在数据库里m_YL1N=5时 显示的是0.00
在数据库里m_YL1N为空时 显示的是0.00(我想让他为空)
为什么转换会错误呢?
------解决方案--------------------
因为m_YL1N是LONG型的,所以用 m_YL1N.SetWindowText(str);结果不能为空
用GetDlgItem(IDC)-> SetWindowText(_T( " "));设置为空