Is it OK to use DecimalSeparator to force Floattostr/Strtofloat functions to use a decimal point

前端 未结 5 1414
天涯浪人
天涯浪人 2021-01-02 08:29

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

5条回答
  •  醉梦人生
    2021-01-02 09:11

    I am/was under the assumption that the global DecimalSeperator variable would not be touched by the RTL. If not, then all these routines have an optional parameter FormatSettings which you could use. Globaly declare a TFormatSettings variable and use it for each occurance of these routines.

    A small benefit of it could be that the routines are thread-safe when you specify your own format settings.

提交回复
热议问题