RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.FloatToTextFmt Function

Converts a floating-point value to an unterminated character string, using a specified format.

Pascal
function FloatToTextFmt(Buf: PAnsiChar; const Value; ValueType: TFloatValue; Format: PAnsiChar): Integer; overload;
function FloatToTextFmt(Buf: PAnsiChar; const Value; ValueType: TFloatValue; Format: PAnsiChar; const FormatSettings: TFormatSettings): Integer; overload;
function FloatToTextFmt(Buf: PWideChar; const Value; ValueType: TFloatValue; Format: PWideChar): Integer; overload;
function FloatToTextFmt(Buf: PWideChar; const Value; ValueType: TFloatValue; Format: PWideChar; const FormatSettings: TFormatSettings): Integer; overload;
C++
int FloatToTextFmt(PAnsiChar Buf, const  Value, TFloatValue ValueType, PAnsiChar Format);
int FloatToTextFmt(PAnsiChar Buf, const  Value, TFloatValue ValueType, PAnsiChar Format, const TFormatSettings FormatSettings);
int FloatToTextFmt(PWideChar Buf, const  Value, TFloatValue ValueType, PWideChar Format);
int FloatToTextFmt(PWideChar Buf, const  Value, TFloatValue ValueType, PWideChar Format, const TFormatSettings FormatSettings);

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 System::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 FormatSettings parameter. Before calling the thread-safe form of FloatToTextFmt, you must populate FormatSettings with localization information. To populate FormatSettings with a set of default locale values, call GetLocaleFormatSettings

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!