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

# VarNumFromParseNum(3w)

## NAME

**VarNumFromParseNum** (OLEAUT32.47)

## SYNOPSIS

HRESULT VarNumFromParseNum\
  (\
   NUMPARSE\* *pNumprs*,\
   BYTE\*     *rgbDig*,\
   ULONG     *dwVtBits*,\
   VARIANT\*  *pVarDst*\
  )

## DESCRIPTION

Convert a **NUMPARSE** structure into a numeric Variant type.

## PARAMS

*pNumprs* **\[In\]**  Source for parsed number. cDig must be set to the size of *rgbDig*.

*rgbDig* **\[In\]**  Source for the numbers digits.

*dwVtBits* **\[In\]**  **VTBIT\_** flags from **"oleauto.h"** indicating the acceptable dest types.

*pVarDst* **\[Out\]**  Destination for the converted Variant value.

## RETURNS

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

**Failure:** **E\_INVALIDARG**, if any parameter is invalid. **DISP\_E\_OVERFLOW**, if the number is too big for the types set in *dwVtBits*.

## NOTES

**-** The smallest favoured type present in *dwVtBits* that can represent the number in *pNumprs* without losing precision is used.

**-** Signed types are preferred over unsigned types of the same size.

**-** Preferred types in order are: integer, float, double, currency then decimal.

**-** Rounding (dropping of decimal points) occurs without error. See **[VarI8FromR8(3w)](/VarI8FromR8/3w.md)** for details of the rounding method.

**-** *pVarDst* is not cleared before the result is stored in it.

**-** WinXP and Win2003 support **VTBIT\_I8**, **VTBIT\_UI8** but that's buggy (by design?): If some other **VTBIT**'s for integers are specified together with **VTBIT\_I8** and the number will fit only in a **VT\_I8** Windows(tm) will **"cast"** the number to the smallest requested integer truncating this way the number. Wine doesn't implement this **"feature"** (yet?).

## IMPLEMENTATION

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

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

Debug channel **"variant"**.
