StrToFloatDef

Delphi

24/05/2005

é simples... estou programando em delphi 5, mas sei que existe a função StrToFloatDef em versões posteriores, se alguem puder me passar como ela é escrita, muito provavelmente fica dentro do SysUtils assim como a StrToFloat.

[]´s


Paulo Cesar

Paulo Cesar

Curtidas 0

Respostas

Kotho

Kotho

24/05/2005

function StrToFloatDef(const S: string;
  const Default: Extended): Extended; overload;
function StrToFloatDef(const S: string; const Default: Extended;
  const FormatSettings: TFormatSettings): Extended; overload;


function StrToFloatDef(const S: string; const Default: Extended): Extended;
begin
  if not TextToFloat(PChar(S), Result, fvExtended) then
    Result := Default;
end;

function StrToFloatDef(const S: string; const Default: Extended;
  const FormatSettings: TFormatSettings): Extended;
begin
  if not TextToFloat(PChar(S), Result, fvExtended, FormatSettings) then
    Result := Default;
end;



GOSTEI 0
POSTAR