Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
procedure GetLocaleFormatSettings(LCID: Integer; var FormatSettings: TFormatSettings);
Populates a TFormatSettings data structure based on the Windows locale ID.
To find out about specific values for LCID search msdn.microsoft.com for "Locales & Languages". To get the system default locale send the LOCALE_SYSTEM_DEFAULT constant (or LOCALE_USER_DEFAULT). Here are some locale ID's (decimal value):
- Croatian: 1050
- English_United_States: 1033
- French_Standard: 1036
- Slovenian: 1060
- German_Standard: 1031
var
s: string;
fs : TFormatSettings;
GetLocaleFormatSettings(LOCALE_SYSTEM_DEFAULT, fs);
s := FloatToStr(100 000 * PI, fs);
//s == '3,141,592.65'
fs.DecimalSeparator := 'D';
fs.ThousandSeparator := 'T';
s := FloatToStr(100 000 * PI, fs);
//s == '3T141T592D65'
|
FloatToStr,
| Free Delphi code snippet inside every Delphi Newsletter! |
|
|
| Got some code to share? Got a question? Need some help? |
|
|