| Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back |
Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
TFormatSettings type |
unit |
| SysUtils | |
| category | |
| declaration |
TFormatSettings = record
CurrencyFormat: Byte;
NegCurrFormat: Byte;
ThousandSeparator: Char;
DecimalSeparator: Char;
CurrencyDecimals: Byte;
DateSeparator: Char;
TimeSeparator: Char;
ListSeparator: Char;
CurrencyString: string;
ShortDateFormat: string;
LongDateFormat: string;
TimeAMString: string;
TimePMString: string;
ShortTimeFormat: string;
LongTimeFormat: string;
ShortMonthNames: array[1..12] of string;
LongMonthNames: array[1..12] of string;
ShortDayNames: array[1..7] of string;
LongDayNames: array[1..7] of string;
TwoDigitYearCenturyWindow: Word;
end;
| description |
To create and use TFormatSettings, follow these steps:
1. Define a variable of type TFormatSettings
2. Call GetLocaleFormatSettings to populate the TFormatSettings variable with locale information.
3. Pass the TFormatSettings variable as the parameter of the string formatting routine.
| example |
var s: string; fs : TFormatSettings; GetLocaleFormatSettings(0, fs); fs.DecimalSeparator := 'D'; fs.ThousandSeparator := 'T'; s := FloatToStr(100 000 * PI, fs); //s == '3T141T592D65' |
| in real code |
| see also |
| Free Delphi code snippet inside every Delphi Newsletter! |
|
|
| Got some code to share? Got a question? Need some help? |
|
|
