oleaut32: Strip trailing decimal zeroes when rounding a number in VarFormat.
This commit is contained in:
parent
d1de5f37d0
commit
80dfd00530
|
@ -380,6 +380,7 @@ static void test_VarFormat(void)
|
|||
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");
|
||||
VARFMT(VT_R8,V_R8,0.0999,"#.##",S_OK,".1");
|
||||
|
||||
|
||||
/* 'out' is not cleared */
|
||||
|
|
|
@ -1313,6 +1313,9 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
|
|||
}
|
||||
else
|
||||
(*prgbDig)++;
|
||||
/* We converted trailing digits to zeroes => have_frac has changed */
|
||||
while (have_frac > 0 && rgbDig[have_int + have_frac - 1] == 0)
|
||||
have_frac--;
|
||||
}
|
||||
}
|
||||
TRACE("have_int=%d,need_int=%d,have_frac=%d,need_frac=%d,pad=%d,exp=%d\n",
|
||||
|
|
Loading…
Reference in New Issue