Commit 18e6bb81 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Fix the case of floats in VarBstrFromR4, VarBstrFromR8 and

VarBstrFromCy. We cannot check for equality of floats or doubles because of rounding errors. Check equality to 14 digits for doubles. Add more precision to the expected results so that they match actual results. Print floating values with more precision so we know what went wrong. Specify the locale for all variant functions that depend on it. Added return codes for Win95. Win95 returns dates with only two digits for the year. Uncommented more VariantCopyInd and VariantChangeTypeEx tests.
parent c7de2085
......@@ -3484,7 +3484,7 @@ HRESULT WINAPI VarBstrFromR4(FLOAT fltIn, LCID lcid, ULONG dwFlags, BSTR* pbstrO
{
TRACE("( %f, %ld, %ld, %p ), stub\n", fltIn, lcid, dwFlags, pbstrOut );
sprintf( pBuffer, "%.7g", fltIn );
sprintf( pBuffer, "%.7G", fltIn );
*pbstrOut = StringDupAtoBstr( pBuffer );
return S_OK;
......@@ -3497,7 +3497,7 @@ HRESULT WINAPI VarBstrFromR8(double dblIn, LCID lcid, ULONG dwFlags, BSTR* pbstr
{
TRACE("( %f, %ld, %ld, %p ), stub\n", dblIn, lcid, dwFlags, pbstrOut );
sprintf( pBuffer, "%.15g", dblIn );
sprintf( pBuffer, "%.15G", dblIn );
*pbstrOut = StringDupAtoBstr( pBuffer );
return S_OK;
......@@ -3515,7 +3515,7 @@ HRESULT WINAPI VarBstrFromCy(CY cyIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
/* Firstly get the currency in a double, then put it in a buffer */
rc = VarR8FromCy(cyIn, &curVal);
if (rc == S_OK) {
sprintf(pBuffer, "%g", curVal);
sprintf(pBuffer, "%G", curVal);
*pbstrOut = StringDupAtoBstr( pBuffer );
}
return rc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment