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

digits.
This commit is contained in:
Bill Medland 2004-02-07 01:28:45 +00:00 committed by Alexandre Julliard
parent e7499dc2cc
commit 8d94d1925d
2 changed files with 5 additions and 1 deletions

View File

@ -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;

View File

@ -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;