C
Chetan Raj
Hi All,
I want to convert a DECIMAL type to double type. Is there any API or
standard function for it? Is there any recommended way to convert it.
Currently I am using the following code to convert.
double nDoubleData;
CComBSTR bstrTemp;
VarBstrFromDec(&(varData.decVal),0x0409,LOCALE_NOUSEROVERRIDE,&(bstrTemp.m_str));
VarR8FromStr((LPWSTR)bstrTemp,0x0409,LOCALE_NOUSEROVERRIDE,&nDoubleData);
//varData.decVal has the DECIMAL value, from which a double type is
extracted into nDoubleData
But, I know that the code is inefficient.
Is there any better way to do it?
Thanking in advance for any help.
Chetan Raj
I want to convert a DECIMAL type to double type. Is there any API or
standard function for it? Is there any recommended way to convert it.
Currently I am using the following code to convert.
double nDoubleData;
CComBSTR bstrTemp;
VarBstrFromDec(&(varData.decVal),0x0409,LOCALE_NOUSEROVERRIDE,&(bstrTemp.m_str));
VarR8FromStr((LPWSTR)bstrTemp,0x0409,LOCALE_NOUSEROVERRIDE,&nDoubleData);
//varData.decVal has the DECIMAL value, from which a double type is
extracted into nDoubleData
But, I know that the code is inefficient.
Is there any better way to do it?
Thanking in advance for any help.
Chetan Raj