GARANTIR DESCONTO

Fórum StrToFloatDef #282879

24/05/2005

0

é 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

Responder

Posts

25/05/2005

Kotho

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;



Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar