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

# VarFormatCurrency(3w)

## NAME

**VarFormatCurrency** (OLEAUT32.127)

## SYNOPSIS

HRESULT VarFormatCurrency\
  (\
   LPVARIANT *pVarIn*,\
   INT       *nDigits*,\
   INT       *nLeading*,\
   INT       *nParens*,\
   INT       *nGrouping*,\
   ULONG     *dwFlags*,\
   BSTR\*     *pbstrOut*\
  )

## DESCRIPTION

Format a variant value as a currency.

## PARAMS

*pVarIn* **\[In\]**  Variant to format.

*nDigits* **\[In\]**  Number of digits following the decimal point (**-1** = user default).

*nLeading* **\[In\]**  Use a leading zero (**-2** = user default, **-1** = yes, **0** = no).

*nParens* **\[In\]**  Use brackets for values \< **0** (**-2** = user default, **-1** = yes, **0** = no).

*nGrouping* **\[In\]**  Use grouping characters (**-2** = user default, **-1** = yes, **0** = no).

*dwFlags* **\[In\]**  Currently unused, set to zero.

*pbstrOut* **\[Out\]**  Destination for formatted string.

## RETURNS

**Success:** **S\_OK**. *pbstrOut* contains the formatted value.

**Failure:** **E\_INVALIDARG**, if any parameter is invalid. **E\_OUTOFMEMORY**, if enough memory cannot be allocated. **DISP\_E\_TYPEMISMATCH**, if the variant cannot be formatted.

## NOTES

This function uses **LOCALE\_USER\_DEFAULT** when determining the currency format characters to use.

## IMPLEMENTATION

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

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

Debug channel **"variant"**.
