FieldPrecision: Integer;
The FieldPrecision property determines the number of decimal places in the table field, which will store attribute values.
The property is relevant if the attribute has real values. The number of decimal places should be less than the total length specified in the FieldSize property.
Executing the example requires that the repository contains an MDM dictionary with the RDS_DICT identifier.
Add links to the Dal, Metabase and Rds system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Dict: IRdsDictionary;
Attr: IRdsAttribute;
Begin
Mb := MetabaseClass.Active;
Dict := Mb.ItemById("RDS_DICT").Edit As IRdsDictionary;
// Add an attribute
Attr := Dict.Attributes.Add;
Attr.Name := "Volume";
Attr.Id := "VOLUME";
Attr.DataType := DbDataType.Float;
Attr.FieldSize := 20;
Attr.FieldPrecision := 8;
// Save changes
(Dict As IMetabaseObject).Save;
End Sub UserProc;
After executing the example a new attribute is added to the specified MDM dictionary. Real data type is set for the attribute, and total length and number of decimal places are set.
See also: