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?

+3


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

).

StrToFloat

:

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.

DecimalSeparator

assigned module SysUtils

internally via GetLocaleInfo

API with LCType

from LOCALE_SDECIMAL

, and is automatically maintained in the block Forms

in response to WM_SETTINGSCHANGE

(GUI application only).




Edit:

+5


source







All Articles