oleaut32: fix a rounding bug in VarFormat.

This commit is contained in:
Damjan Jovanovic 2009-05-12 18:41:41 +02:00 committed by Alexandre Julliard
parent 52722e6638
commit 560e76ee38
2 changed files with 5 additions and 1 deletions

View File

@ -379,6 +379,7 @@ static void test_VarFormat(void)
VARFMT(VT_R8,V_R8,-1.57,"0.00",S_OK,"-1.57");
VARFMT(VT_R8,V_R8,-1.57,"#.##",S_OK,"-1.57");
VARFMT(VT_R8,V_R8,-0.1,".#",S_OK,"-.1");
VARFMT(VT_R8,V_R8,0.099,"#.#",S_OK,".1");
/* 'out' is not cleared */

View File

@ -1305,7 +1305,10 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
else
{
rgbDig[have_int + need_frac] = 0;
have_int++;
if (exponent < 0)
exponent++;
else
have_int++;
}
}
else