Mega Code Archive

 
Categories / Delphi / Examples
 

International settings

By default, Delphi gets its date/time, currency and numeric format from Control Panel's International settings. This can lead to errors, when parsing dates, numbers or lists. To avoid these errors, you can set the constants defined in Delphi, like DecimalSeparator, ShortDateFormat and others like this: DecimalSeparator := '.'; ShortDateFormat := 'mm/dd/yy'; This will override the default settings assuring the correct values. To a complete list of these variables, look at Currency Formatting Variables in Delphi Help