Currently, I\'m setting DecimalSeparator to a \'.\' in each procedure which uses these functions.
It would be much easier to set this globally at the start of the pr
It's OK if you have no alternative. Prefer the versions of those functions that accept a TFormatSettings
parameter, if your Delphi version is recent enough, so that you don't interfere with any other code that relies on that global variable for locale-aware behavior.
FloatToStr
and StrToFloat
are locale-sensitive functions. If you need to convert your floating-point value to a string to persist it somewhere that a program will read later (such as to a file, the registry, or a network socket), then you should use the locale-independent functions Str
and Val
for your conversions instead. They always use .
for the decimal separator, regardless of the DecimalSeparator
variable or other environmental settings.