FormatDoublePrec(Value: Double; Precision: Integer): String;
Value. Value converted into string type.
Precision. Number precision (number of decimal places). Number precision can be set in the range [0; 14].
The FormatDoublePrec method rounds real number to the specified precision and converts it into string type according to regional standard settings.
Sub UserProc;
Var
CF: ICultureInfo;
s: String;
Begin
CF := CultureInfo.Current;
s := CF.FormatDoublePrec(12312300000.1123, 2);
End Sub UserProc;
After executing the example, the "s" variable will contain string value of the 12312300000.1123 number rounded to two decimal places. The value will be 12312300000.11 for Russian regional standard settings.
See also:
ICultureInfo | ICultureInfo.FormatDouble | ICultureInfo.FormatDoubleWithGroupingSeparator