ICultureInfo.FormatDoublePrec

Syntax

FormatDoublePrec(Value: Double; Precision: Integer): String;

Parameters

Value. Value converted into string type.

Precision. Number precision (number of decimal places). Number precision can be set in the range [0; 14].

Description

The FormatDoublePrec method rounds real number to the specified precision and converts it into string type according to regional standard settings.

Example

Sub UserProc;
Var
    CF: ICultureInfo;
    s: String;
Begin
    CF := CultureInfo.Current;
    s := CF.FormatDoublePrec(12312300000.11232);
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