VarFormatPercent Function

Formats a variant containing percentages into a string form.

HRESULT VarFormatPercent(
  LPVARIANT pvarIn,
  int   iNumDig,
  int ilncLead,
  int iUseParens,
  int iGroup,
  ULONG  dwFlags,
  BSTR *pbstrOut
);

pvarIn

[in] The variant containing the value to format.

iNumDig

[in] Specifies the number of digits to pad to after the decimal point. -1 means to use the system default value.

ilncLead

[in] Specifies whether to include the leading digit on numbers. -2 means to use the system default value, -1 is true, 0 is false.

iUseParens

[in] Specifies whether negative numbers should use parenthesis. For example, (10,10) v. -10.10, -2 means to use the system default, -1 is true, 0 is false.

iGroup

[in] Specifies whether thousands should be grouped. For example 10,000 v. 10000, -2 means to use the system default, -1 is true, 0 is false.

NoteNote

Regular numbers and currencies have separate system defaults for all the above options.

dwFlags

[in] VAR_CALENDAR_HIJRI is the only flag that can be set.

pbstrOut

[out] Points to the formatted string that represents the variant.

The function returns one of the following:

Return value

Meaning

S_OK

Success.

E_INVALIDARG

One or more of the arguments is invalid.

This functions uses the user's default locale while calling VarTokenizeFormatString and VarFormatFromTokens.

Show:
© 2014 Microsoft