Commit 560e76ee authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

oleaut32: fix a rounding bug in VarFormat.

parent 52722e66
......@@ -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 */
......
......@@ -1305,6 +1305,9 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
else
{
rgbDig[have_int + need_frac] = 0;
if (exponent < 0)
exponent++;
else
have_int++;
}
}
......
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