oleaut32: Implement VarDecInt.

This commit is contained in:
Juan Lang 2009-02-18 09:06:19 -08:00 committed by Alexandre Julliard
parent 48d1f9fba1
commit 32bacc9c0b
1 changed files with 10 additions and 2 deletions

View File

@ -5702,14 +5702,22 @@ HRESULT WINAPI VarDecFix(const DECIMAL* pDecIn, DECIMAL* pDecOut)
*/
HRESULT WINAPI VarDecInt(const DECIMAL* pDecIn, DECIMAL* pDecOut)
{
double dbl;
HRESULT hr;
if (DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
return E_INVALIDARG;
if (!(DEC_SIGN(pDecIn) & DECIMAL_NEG) || !DEC_SCALE(pDecIn))
return VarDecFix(pDecIn, pDecOut); /* The same, if +ve or no fractionals */
FIXME("semi-stub!\n");
return DISP_E_OVERFLOW;
hr = VarR8FromDec(pDecIn, &dbl);
if (SUCCEEDED(hr)) {
LONGLONG rounded = dbl >= 0.0 ? dbl + 0.5 : dbl - 0.5;
hr = VarDecFromI8(rounded, pDecOut);
}
return hr;
}
/************************************************************************