ITableField.Precision

Syntax

Precision: Integer;

Description

The Precision property determines quantity of decimal digits if field type is Real.

Example

Executing this example requires that the repository contains a table with the Table_1 identifier.

Sub Main;

Var

MB: IMetabase;

Table: ITable;

Fields: ITableFields;

Field: ITableField;

Begin

MB := MetabaseClass.Active;

Table := MB.ItemById("Table_1").Edit As ITable;

Fields := Table.Fields;

Field := Fields.Add;

Field.DataType := DbDataType.Float;

Field.Id := "NewFloat";

Field. Name: = "New real field";

Field.Size := 10;

Field.Precision := 3;

(Table As IMetabaseObject).Save;

End Sub Main;

After executing the example, a new real field is created in the table. Field total length is 10 symbols, quantity of decimal digits is 3.

See also:

ITableField