* getlocalformatsettings, Mantis 10389

git-svn-id: trunk@15691 -
This commit is contained in:
marco 2010-08-02 20:32:50 +00:00
parent 591dbb66df
commit 1181115baa

View File

@ -60,6 +60,7 @@ Procedure RaiseLastWin32Error;
function GetFileVersion(const AFileName: string): Cardinal; function GetFileVersion(const AFileName: string): Cardinal;
procedure GetFormatSettings; procedure GetFormatSettings;
procedure GetLocaleFormatSettings(LCID: Integer; var FormatSettings: TFormatSettings); platform;
implementation implementation
@ -651,13 +652,15 @@ Begin
End; End;
procedure GetFormatSettings; procedure GetLocaleFormatSettings(LCID: Integer; var FormatSettings: TFormatSettings);
var var
HF : Shortstring; HF : Shortstring;
LID : LCID; LID : Windows.LCID;
I,Day : longint; I,Day : longint;
begin begin
LID := GetThreadLocale; LID := LCID;
with FormatSettings do
begin
{ Date stuff } { Date stuff }
for I := 1 to 12 do for I := 1 to 12 do
begin begin
@ -693,7 +696,12 @@ begin
DecimalSeparator:=GetLocaleChar(LID, LOCALE_SDECIMAL, '.'); DecimalSeparator:=GetLocaleChar(LID, LOCALE_SDECIMAL, '.');
CurrencyDecimals:=StrToIntDef(GetLocaleStr(LID, LOCALE_ICURRDIGITS, '0'), 0); CurrencyDecimals:=StrToIntDef(GetLocaleStr(LID, LOCALE_ICURRDIGITS, '0'), 0);
end; end;
end;
procedure GetFormatSettings;
begin
GetlocaleFormatSettings(GetThreadLocale, DefaultFormatSettings);
end;
Procedure InitInternational; Procedure InitInternational;
var var