LocalValueFormat: String;
LocalValueFormat: String;
The LocalValueFormat property determines the data display format in a table column according to regional parameters settings.
A data format is generated using reserved format codes. Codes are described in the section Number Format. When specifying the format the separators, that are determined by current regional settings must be used.
Changing the value of the LocalValueFormat property results in changing the value of the ValueFormat property. When the user determines the LocalValueFormat property value, this value is converted to a common form (ignoring the regional settings) and is inserted into the ValueFormat property. When getting the LocalValueFormat property value, the ValueFormat property value converted to localized format is returned.
Executing the example requires a form with the Button1 button and the DataGrid component named DataGrid1. In regional settings a point must be set as a decimal separator.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Format, LocalFormat: String;
Begin
Column := DataGrid1.Columns.Item(0);
Column.LocalValueFormat := "0.00";
Format := Column.ValueFormat;
LocalFormat := Column.LocalValueFormat;
End Sub Button1OnClick;
After executing the example the following format is set for the first column: number with two decimal digits. The Format variable is to store the following common template for a number not considering the regional parameters: 0,00. The LocalFormat variable is to store (considering the regional parameters) the following template for a number: 0.00.
See also: