System.SysUtils.FloatToTextFmt
Delphi
function FloatToTextFmt(Buf: PAnsiChar; const Value; ValueType: TFloatValue; Format: PAnsiChar): Integer;
function FloatToTextFmt(Buf: PAnsiChar; const Value; ValueType: TFloatValue;
Format: PAnsiChar; const AFormatSettings: TFormatSettings): Integer;
function FloatToTextFmt(Buf: PWideChar; const Value; ValueType: TFloatValue;
Format: PWideChar): Integer;
function FloatToTextFmt(Buf: PWideChar; const Value; ValueType: TFloatValue;
Format: PWideChar; const AFormatSettings: TFormatSettings): Integer; overload;
C++
extern DELPHI_PACKAGE int __fastcall FloatToTextFmt _DEPRECATED_ATTRIBUTE1("Moved to the AnsiStrings unit") (char * Buf, const void *Value, TFloatValue ValueType, char * Format)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Warning: The ANSI version of FloatToTextFmt is deprecated. Please use the AnsiStrings unit.
Converts a floating-point value to an unterminated character string, using a specified format.
Use FloatToTextFmt to format a floating-point value, using a format string rather than using a predefined format. To use a predefined format, use the FloatToText or FloatToStrF function instead.
The Value
parameter must be a variable of type Extended or Currency, as indicated by the ValueType
parameter. The resulting string of characters is stored in the given buffer, and the returned value is the number of characters stored. The resulting string is not null-terminated.
Formats supported are described as part of the FormatFloat function.
The first form of FloatToTextFmt is not thread-safe, because it uses localization information contained in global variables. The second form of FloatToTextFmt, which is thread-safe, refers to localization information contained in the AFormatSettings
parameter. Before calling the thread-safe form of FloatToTextFmt, you must populate AFormatSettings
with localization information. To populate AFormatSettings
with a set of default locale values, call TFormatSettings.Create.