Commit 8d94d192 authored by Bill Medland's avatar Bill Medland Committed by Alexandre Julliard

Correct GetNumberFormat for negative numbers with e.g. 3 leading

digits.
parent e7499dc2
......@@ -1134,7 +1134,7 @@ GetNumberFormatW_Error:
dwState |= NF_DIGITS_OUT;
dwCurrentGroupCount++;
if (szSrc >= lpszValue && dwCurrentGroupCount == dwGroupCount)
if (szSrc >= lpszValue && dwCurrentGroupCount == dwGroupCount && *szSrc != '-')
{
LPWSTR lpszGrp = lpFormat->lpThousandSep + strlenW(lpFormat->lpThousandSep) - 1;
......
......@@ -660,6 +660,10 @@ static void test_GetNumberFormatA()
ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer));
EXPECT_VALID; EXPECT_LENA; EXPECT_EQA;
STRINGSA("-353","-353.00"); /* test for off by one error in grouping */
ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer));
EXPECT_VALID; EXPECT_LENA; EXPECT_EQA;
STRINGSA("2353.1","2,353.10"); /* Valid real number */
ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer));
EXPECT_VALID; EXPECT_LENA; EXPECT_EQA;
......
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