Einzelnen Beitrag anzeigen

Benutzerbild von user0815
user0815

Registriert seit: 5. Okt 2007
331 Beiträge
 
Delphi XE2 Professional
 
#13

Re: Nach Dezimalzeichen (. oder ,) des Systems fragen. Wie?

  Alt 28. Mär 2008, 06:40
Ich habe auch gesucht wie ich es umsetze & jetzt so gelöst.

Delphi-Quellcode:
function String_To_Double(Zahl : String) : Double;
begin
  try
    case DecimalSeparator of
     '.' : Result := StrToFloat(StringReplace(Zahl, ',', DecimalSeparator, []));
     ',' : Result := StrToFloat(StringReplace(Zahl, '.', DecimalSeparator, []));
     else Result := StrToFloat(FloatToStr(0.0));
    end;
  except
    Result := StrToFloat(FloatToStr(0.0));
  end;
end;
  Mit Zitat antworten Zitat