Precision: Integer;
The Precision property enables the user to determine the precision of displayed scale values.
Executing the example requires a form with the Button1 button and the SpeedometerBox component named SpeedometerBox1.
Sub Button1OnClick(Sender:Object; Args: IMouseEventArgs);
Var
s: ISpeedometer;
Scale: ISpeedometerScale;
Begin
s := SpeedometerBox1.Speedometer;
s.BeginUpdate;
Scale := s.Scales.Item(0);
Scale.MajorTickCount:= 10;
Scale.MinorTickCount:= 5;
Scale.MaxValue := 100;
Scale.MinValue := -100;
Scale.Precision := 2;
s.EndUpdate;
End Sub Button1OnClick;
After executing the example, on clicking the button, the parameters of speedometer scale that is displayed in the SpeedometerBox1 component are changed. The minimum and maximum displayed value, the number of major and minor tick marks are determined for the scale. The values on the scale are displayed with a precision up to two decimal places.
See also: