Commit 84c1f667 authored by Walt Ogburn's avatar Walt Ogburn Committed by Alexandre Julliard

Keep "trailing" zeros on whole number part of a decimal.

Add an example of this to tests.
parent f5c25e80
......@@ -1048,6 +1048,12 @@ static void test_VarParseNumFromStr(void)
CONVERT("-0.51", NUMPRS_STD);
EXPECT(2,NUMPRS_STD,NUMPRS_NEG|NUMPRS_DECIMAL|NUMPRS_LEADING_MINUS,5,0,-2);
EXPECT2(5,1);
/* Keep trailing zeros on whole number part of a decimal */
CONVERT("40.1", NUMPRS_STD);
EXPECT(3,NUMPRS_STD,NUMPRS_DECIMAL,4,0,-1);
EXPECT2(4,0);
EXPECTRGB(2,1);
}
static HRESULT (WINAPI *pVarNumFromParseNum)(NUMPARSE*,BYTE*,ULONG,VARIANT*);
......
......@@ -1735,13 +1735,6 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags,
pNumprs->dwOutFlags |= NUMPRS_DECIMAL;
cchUsed++;
/* Remove trailing zeros from the whole number part */
while (pNumprs->cDig > 1 && !rgbTmp[pNumprs->cDig - 1])
{
pNumprs->nPwr10++;
pNumprs->cDig--;
}
/* If we have no digits so far, skip leading zeros */
if (!pNumprs->cDig)
{
......
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