In my application i want to return a value into an edit box. i know that i have to change the value in a string type value.
So, as the value i want to return is a double i would like to use the function _ecvt.
But i have a pb with it, because if i want to return for example a number as 3.14, there is no pb, but if the value is 0.0314, the first 0 after "." is not taken.
In my code i do that:
int decimal,sign;
.
.
.
m_dlgPrice=0.0314;
strParam=_fcvt(m_dlgPrice,4,&decimal,&sign);
CString strInt=strParam.Left(decimal);
CString strDecimal =strParam.Mid(decimal); strParamFin.Format("%s.%s",strInt,strDecimal);
CEdit* Edit=(CEdit*)GetDlgItem(IDC_PRICE);
Edit->SetWindowText(strParamFin);
and in the edit box i could only see .314, so where is the pb?
thanks in advance for your help.
jayjay
So, as the value i want to return is a double i would like to use the function _ecvt.
But i have a pb with it, because if i want to return for example a number as 3.14, there is no pb, but if the value is 0.0314, the first 0 after "." is not taken.
In my code i do that:
int decimal,sign;
.
.
.
m_dlgPrice=0.0314;
strParam=_fcvt(m_dlgPrice,4,&decimal,&sign);
CString strInt=strParam.Left(decimal);
CString strDecimal =strParam.Mid(decimal); strParamFin.Format("%s.%s",strInt,strDecimal);
CEdit* Edit=(CEdit*)GetDlgItem(IDC_PRICE);
Edit->SetWindowText(strParamFin);
and in the edit box i could only see .314, so where is the pb?
thanks in advance for your help.
jayjay