I have variant of VT_R4/float type with value "2.550000" when converting it to double using VariantChangeType() to VT_R8/double type value becomes "2.54999999998".
::VariantChangeType(&var, &var, 0, VT_BSTR);
::VariantChangeType(&var, &var, 0, VT_R8);
double dOutputValue = var.dblVal;
this double when is when rounded of using
output.Format(_T("%3.1f"), dOutputValue);
gives value 2.5, instead of 2.6 as expected.
Please suggest.