Help Center

CMoney.FormatNumbermethod

Formats a currency into a string form.

Numeric Datatypesmethoddocumented

Syntax

FUNCTION FormatNumber (BYVAL iNumDig AS LONG = -1, BYVAL ilncLead AS LONG = -2, BYVAL iUseParens AS LONG = -2, BYVAL iGroup AS LONG = -2, BYVAL dwFlags AS DWORD = 0) AS DWSTRING

Parameters

NameDescription
iNumDigThe number of digits to pad to after the decimal point. Specify -1 to use the system default value.
ilncLeadSpecifies whether to include the leading digit on numbers.
-2 : Use the system default.
-1 : Include the leading digit.
0 : Do not include the leading digit.
iUseParensSpecifies whether negative numbers should use parentheses.
-2 : Use the system default.
-1 : Use parentheses.
0 : Do not use parentheses.
iGroupSpecifies whether thousands should be grouped. For example 10,000 versus 10000.
-2 : Use the system default.
-1 : Group thousands.
0 : Do not group thousands.
dwFlagsVAR_CALENDAR_HIJRI is the only flag that can be set.

Return value

A string containing the formatted value.

Description

Formats a currency into a string form.

Remarks

Same as FormatCurrency but without adding the currency symbol.

Example

DIM cur AS CMoney = 12345.1234 PRINT cur.FormatNumber --> 12.345,12 (Spain)

Reference

  • Defined in AfxNova/CMoney.inc:457
  • Documented in Numeric Datatypes/CMoney Class.md
  • Topic: CMoney Class