GetFieldDecimals()

Summary

Returns the number of displayed decimal places for a real-typed field.

Syntax

field_decimals = GetFieldDecimals(string field_spec)

Argument Contents
field_spec A field specification

Returns

An integer indicating the number of decimal places displayed. GetFieldDecimals() returns zero (0) if the field is integer-typed or string-typed.

Notes

  • The number of displayed decimal places is used when the field is displayed in a new editor. It is also used when the field is exported (see ExportView()).

  • The number of displayed decimal places can be changed with SetFieldDecimals().

  • The number of displayed decimal places is not necessarily equal to the actual number of decimal places in the data file.

Example

ndec = GetFieldDecimals("Employee.PayRate")

Error Codes

Error Type Meaning
Error The input field specification is ambiguous
NotFound The input field does not exist

See Also

Function Summary
SetFieldDecimals() Changes the number of displayed decimals for a real-typed field
GetFieldInfo() Returns the data type, display width, decimals, and index flag for a field