Correct GetNumberFormat for negative numbers with e.g. 3 leading
digits.
This commit is contained in:
parent
e7499dc2cc
commit
8d94d1925d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue