How do I get the character set used for numbers in a Delphi 6 language based program?

Is there a Windows API call or Delphi call that will tell me which character set Delphi 6 expects to be used by numbers, using its format conversion routines like StrToFloat ()? For example, how can I tell if Delphi will expect to see a comma or a period for the decimal point?


source to share

1 answer

Not sure if it's GetLocaleFormatSettings

available in D6. (but not in D5).
You can use global variable DecimalSeparator

( SysUtils




The global variable DecimalSeparator defines the character to be used as the decimal point. Thousands separators ( ThousandSeparator ) and currency symbols in a row are not allowed. If S does not contain a valid value, StrToFloat throws an EConvertError exception.


assigned module SysUtils

internally via GetLocaleInfo

API with LCType


, and is automatically maintained in the block Forms

in response to WM_SETTINGSCHANGE

(GUI application only).




All Articles