Show: Delphi C++
Display Preferences

System.AnsiStrings.FloatToTextFmt

From RAD Studio API Documentation
Jump to: navigation, search

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;

C++

extern DELPHI_PACKAGE int __fastcall FloatToTextFmt(char * Buf, const void *Value, System::Sysutils::TFloatValue ValueType, char * Format)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.AnsiStrings.pas
System.AnsiStrings.hpp
System.AnsiStrings System.AnsiStrings

Description

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.

See Also

Personal tools
RAD Studio 10.2 Tokyo
In Other Languages
Previous Versions
Assistance