一、程序目录:
二、源码:
主要是定义CString数据类型,然后进行Format格式化
void CFormatStrDlg::OnFormat()
{
// TODO: Add your control notification handler code here
UpdateData(true);
switch(m_radio)
{
case 0:
m_strValue.Format("%+.3e",m_doubleValue);//转换为指数形式
break;
case 1:
m_strValue.Format("%+10.2f",m_doubleValue);//转换为小数形式
break;
}
UpdateData(false);
}
三、运行结果:
四、 资源
https://download.csdn.net/download/sunjikui1255326447/12274438