Icon StrToFloatDef

Unit: Internal

Available In: Client and Server Applications

function StrToFloatDef(const Value: String;
                       DefaultValue: Double=0): Double

The StrToFloatDef function converts the formatted string input parameter into its native value. The decimal separator used in the formatted string is determined by the TFormatSettings DecimalSeparator property. If the input parameter is not a valid floating-point string, the return value is the specified default value.

Examples

A := StrToFloatDef('1200.548', 0);
X := FloatToStr(A);  // X is '1200.548'
Image