Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GETTING LOCALE SETTINGS

Status
Not open for further replies.

hbez

Instructor
Mar 25, 2003
49
ZA
Could someone please show me a simple method for retrieving the currency symbol from the Regional Settings on my PC?
 
Have you tried Google?

I googled on Delphi Regional Settings and found this which seems to be a useful class:


You can use it something like this:
Code:
uses o_RegionalSettings;

procedure TForm1.Button1Click(Sender: TObject);
var
  rs: TgtRegionalSettings;
begin
  rs := TgtRegionalSettings.Create(nil);
  try
    edit1.text := rs.SysCurrencySymbol;
  finally
    rs.Free;
  end;
end;

Andrew
Hampshire, UK
 
After a LONG search I came up with:

procedure TForm1.FormActivate(Sender: TObject);
var
formatSettings : TFormatSettings;
begin
GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, formatSettings);
lbl1.Caption := formatSettings.CurrencyString;
end;

I'll give your suggestion a try as well.

Thanks
Hannes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top