How do I get the character set used for numbers in a Delphi 6 language based program?
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:
-
GetLocaleFormatSettings
available from D7. -
DecimalSeparator
deprecated in newer Delphi (useFormatSettings.DecimalSeparator
).
source to share