---
name: "VarFix"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/VarFix"
---

# VarFix(3w)

## NAME

**VarFix** (OLEAUT32.169)

## SYNOPSIS

HRESULT VarFix\
  (\
   LPVARIANT *pVarIn*,\
   LPVARIANT *pVarOut*\
  )

## DESCRIPTION

Truncate a variants value to a whole number.

## PARAMS

*pVarIn* **\[In\]**  Source variant.

*pVarOut* **\[Out\]**  Destination for converted value.

## RETURNS

**Success:** **S\_OK**. *pVarOut* contains the converted value.

**Failure:** An **HRESULT** error code indicating the error.

## NOTES

**-** The type of the value stored in *pVarOut* depends on the type of *pVarIn*, according to the following table: \
\
  Input Type       Output Type\
\
  \----------       -----------\
\
   VT\_BOOL          VT\_I2\
\
   VT\_EMPTY         VT\_I2\
\
   VT\_BSTR          VT\_R8\
\
   All Others       Unchanged

**-** The difference between this function and **[VarInt(3w)](/VarInt/3w.md)** is that **[VarInt(3w)](/VarInt/3w.md)** rounds negative numbers away from **0**, while this function rounds them towards zero.

## IMPLEMENTATION

Declared in **"oleauto.h"**.

Implemented in **"dlls/oleaut32/variant.c"**.

Debug channel **"variant"**.
