Commit 83455824 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

oleaut32: Handle exponent in VarBstrFromR[48] in non-English locales.

parent 5ffed883
......@@ -4570,11 +4570,11 @@ static void test_VarBstrFromR4(void)
{ 1.0e14, L"1E+14" },
{ 999999999999999.0, L"1E+15" },
{ 1000000000000000.0, L"1E+15" },
{ 1200000000000000.0, L"1,2E+15", TRUE },
{ 1200000000000000.0, L"1,2E+15" },
{ 1.0e15, L"1E+15" },
{ 1.000e16, L"1E+16" },
{ 1.234e16, L"1,234E+16", TRUE },
{ 1.234e16, L"1,234E+16" },
{ M_PI, L"3,141593" },
{ 0.0, NULL }
......@@ -4710,11 +4710,11 @@ static void test_VarBstrFromR8(void)
{ 1.0e14, L"100000000000000" },
{ 999999999999999.0, L"999999999999999" },
{ 1000000000000000.0, L"1E+15" },
{ 1200000000000000.0, L"1,2E+15", TRUE },
{ 1200000000000000.0, L"1,2E+15" },
{ 1.0e15, L"1E+15" },
{ 1.000e16, L"1E+16" },
{ 1.234e16, L"1,234E+16", TRUE },
{ 1.234e16, L"1,234E+16" },
{ 0.0, NULL }
};
......
......@@ -6497,7 +6497,7 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl
}
else
{
WCHAR *p;
WCHAR *p, *e;
WCHAR numbuff[256];
WCHAR empty[] = L"";
NUMBERFMTW minFormat;
......@@ -6512,9 +6512,11 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl
(WCHAR *)&minFormat.LeadingZero, sizeof(DWORD)/sizeof(WCHAR) );
/* count number of decimal digits in string */
p = wcschr( buff, '.' );
if (p) minFormat.NumDigits = lstrlenW(p + 1);
p = wcschr(buff, '.');
e = wcschr(p ? ++p : buff, 'E');
if (p) minFormat.NumDigits = e ? e - p : lstrlenW(p);
if (e) *e = '\0';
numbuff[0] = '\0';
if (!GetNumberFormatW(lcid, 0, buff, &minFormat, numbuff, ARRAY_SIZE(numbuff)))
{
......@@ -6523,6 +6525,11 @@ static BSTR VARIANT_BstrReplaceDecimal(const WCHAR * buff, LCID lcid, ULONG dwFl
}
else
{
if (e)
{
*e = 'E';
wcscat(numbuff, e);
}
TRACE("created minimal NLS string %s\n", debugstr_w(numbuff));
bstrOut = SysAllocString(numbuff);
}
......
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