GetFormatNumber Method for LCField

This method retrieves the format of a number type field. It is only valid for fields of type int, currency, float or numeric.

Use the LCField.SetFormatNumber method to assign stream format information. Refer to the Field Format section for a description of format values.

Defined In

LCField

Syntax

Call thisField.GetFormatNumber (numberFlags, size, precision, scale)

Parameters

All GetFormatNumber<type> parameters are outputs.

Parameter

Description

numberFlags

Long. Optional. Formatting flags of the number field. Refer in this chapter to "LCField Class Methods and Properties Summary," Field Number Format section for a description of the flags.

size

Long. Optional. Size in bytes of the number field. Zero indicates the size of the corresponding number object (LONG, DOUBLE, LCCURRENCY, or LCNUMERIC).

precision

Long. Optional. Precision of the number field. Zero indicates not used for this field.

scale

Long. Optional. Scale of the number field. Zero indicates not used for this field. Since zero is also a valid scale value, a constant LCSCALE_ZERO is defined which can be used to indicate a zero scale.

Usage Notes®

"Precision" refers to the total number of digits that may be stored in the field. "Scale" refers to the number of digits precision to store after the decimal point.

The size, precision, and scale values are ignored with the LCTYPE_FLOAT and LCTYPE_INT types. These are system data types, whose operation is not customizable.

Example

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim field As New LCField (LCTYPE_NUMERIC)
  Dim flags As Long
  Call field.SetFormatNumber (LCNUMBERF_UNSIGNED, , 10, 4)
  Call field.GetFormatNumber (flags)
  Print "The number flag setting is " & Hex(flags) & "h"
End Sub

Example Output

The number flag setting is 1h.