Mega Code Archive

 
Categories / Delphi / Strings
 

Check if a string is a valid floating-point number

function IsStrFloatNum(s: string): Boolean; begin try // try to convert the string into a floatnumber StrToFloat(s); // if there is no error the result is true Result := True; except // if there is any error the result is false Result := False; end; end;