Um meinen Vorschlag mal zu konkretisieren (hoffe mal, das geht alles unter D2006):
Delphi-Quellcode:
var
AllFormatSettings: array of TFormatSettings;
procedure InitFormatSettings;
const
cLocales: array[0..5] of Integer
= (
1031, { German }
1033, { English }
1040, { Italian }
1055, { Turkish }
3082, { Spanish }
LOCALE_USER_DEFAULT);
var
I: Integer;
begin
SetLength(AllFormatSettings, Length(cLocales));
for I := 0 to Length(cLocales) - 1 do begin
GetLocaleFormatSettings(cLocales[I], AllFormatSettings[I]);
end;
end;
function TryStrToFloatAll(const S: string; out Value: Double): Boolean;
var
I: Integer;
begin
Result := True;
for I := 0 to Length(AllFormatSettings) - 1 do begin
if TryStrToFloat(S, Value, AllFormatSettings[I]) then Exit;
end;
Result := False;
end;