Icon FloatToStr

Unit: WebCore

Available In: Client and Server Applications

function FloatToStr(Value: Double; Decimals: Integer=-1): String

The FloatToStr function returns a formatted string for the Double input parameter. The decimal separator used in the formatted string is determined by the TFormatSettings DecimalSeparator property. The optional Decimals input parameter determines the number of decimal places used in the formatted string. The return value is a String value.

Examples

A := StrToFloat('1200.548');
X := FloatToStr(A);  // X is '1200.548'

A := StrToFloat('1200.548');
X := FloatToStr(A,2);  // X is '1200.55'
Image