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: PChar; const Value; ValueType: TFloatValue; Format: PChar): Integer; overload;
function FloatToTextFmt(Buf: PChar; const Value; ValueType: TFloatValue; Format: PChar; const FormatSettings: TFormatSettings): Integer; overload;
C++
int FloatToTextFmt(const char * Buf, const  Value, TFloatValue ValueType, const char * Format);
int FloatToTextFmt(const char * Buf, const  Value, TFloatValue ValueType, const char * Format, const TFormatSettings FormatSettings);

SysUtils

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 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) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!