System.SysUtils.FloatToText
Delphi
function FloatToText(BufferArg: PWideChar; const Value; ValueType: TFloatValue; Format: TFloatFormat; Precision, Digits: Integer): Integer;
function FloatToText(BufferArg: PAnsiChar; const Value; ValueType: TFloatValue; Format: TFloatFormat; Precision, Digits: Integer): Integer;
function FloatToText(BufferArg: PWideChar; const Value; ValueType: TFloatValue; Format: TFloatFormat; Precision, Digits: Integer; const AFormatSettings: TFormatSettings): Integer;
function FloatToText(BufferArg: PAnsiChar; const Value; ValueType: TFloatValue; Format: TFloatFormat; Precision, Digits: Integer; const AFormatSettings: TFormatSettings): Integer;
C++
extern DELPHI_PACKAGE int __fastcall FloatToText(System::WideChar * BufferArg, const void *Value, TFloatValue ValueType, TFloatFormat Format, int Precision, int Digits)/* 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 FloatToText is deprecated. Please use the AnsiStrings unit.
Converts a floating-point value to an unterminated character string, using a specified Format, Precision, and Digits.
FloatToText converts the given floating-point value to its decimal representation, using the specified format, precision, and digits. 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.
The first form of FloatToText is not thread-safe, because it uses localization information contained in global variables. The second form of FloatToText, which is thread-safe, refers to localization information contained in the AFormatSettings
parameter. Before calling the thread-safe form of FloatToText, you must populate AFormatSettings
with localization information. To populate AFormatSettings
with a set of default locale values, call TFormatSettings.Create.