From 84c1f667aecca39ba4fbed759e5194bf22056801 Mon Sep 17 00:00:00 2001 From: Walt Ogburn Date: Tue, 19 Oct 2004 21:08:40 +0000 Subject: [PATCH] Keep "trailing" zeros on whole number part of a decimal. Add an example of this to tests. --- dlls/oleaut32/tests/vartest.c | 6 ++++++ dlls/oleaut32/variant.c | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index e9cc938f4a1..8b3e4827a0c 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -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*); diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 3ff7d717b5e..1fb24b8be2b 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -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) {