Is there a Windows API call or Delphi call that will tell me what character set Delphi 6 is expecting to be used by numbers by its format conversion routines such as StrToFloat()? For example, how can I find out if Delphi will expect to see a comma or a period for the decimal point?
Share
Not sure if
GetLocaleFormatSettingsis available in D6. (but it’s not in D5).You could use
DecimalSeparatorglobal variable (SysUtils).StrToFloat:DecimalSeparatoris assigned by theSysUtilsunit by internally using theGetLocaleInfoAPI withLCTypeofLOCALE_SDECIMAL, and maintained automatically in theFormsunit in response toWM_SETTINGSCHANGE(GUI application only).Edit:
GetLocaleFormatSettingsis available since D7.DecimalSeparatoris deprecated in newer version of Delphi (UseFormatSettings.DecimalSeparator).