Keep "trailing" zeros on whole number part of a decimal.
Add an example of this to tests.
This commit is contained in:
parent
f5c25e8067
commit
84c1f667ae
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue