SysUtils.FloatToTextFmt

From RAD Studio VCL Documentation (German)
Jump to: navigation, search

Contents

Delphi-Informationen

von SysUtils.pas

	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;


Unit: SysUtils

Typ: Funktion

Sichtbarkeit: public

C++-Informationen

von SysUtils.hpp

	int __fastcall FloatToTextFmt(char * Buf,
		const void * Value,
		Sysutils::TFloatValue ValueType,
		char * Format);


Unit: SysUtils

Typ: Funktion

Beschreibung

Konvertiert eine Gleitkommazahl in eine Dezimaldarstellung mit dem angegebenen Format.


Mit FloatToTextFmt können Sie die Formatierung eines Gleitkommawertes mit Hilfe eines Format-Strings statt mit einem vordefinierten Format durchführen. Um ein vordefiniertes Format zu verwenden, rufen Sie stattdessen die Funktion FloatToText oder FloatToStrF auf.

Value muss eine Variable des Typs Extended oder Currency sein, wie im Parameter ValueType angegeben. Das Ergebnis ist ein Zeichen-String, der in den angegebenen Puffer gespeichert wird, und der Rückgabewert liefert die Anzahl der gespeicherten Zeichen. Der String ist nicht nullterminiert.

Eine Tabelle mit den unterstützten Formate finden in der Beschreibung der Funktion FormatFloat.

Die erste Form von FloatToTextFmt ist nicht Thread-sicher, da die landesspezifischen Informationen der globalen Variablen verwendet werden. Der Thread-sicheren zweiten Form werden die landesspezifischen Informationen im Parameter FormatSettings übergeben. Bevor Sie diese Form von FloatToTextFmt aufrufen, müssen Sie die Informationen in den Parameter FormatSettings aufnehmen. Die landesspezifischen Standardinformationen können FormatSettings mit GetLocaleFormatSettings zugewiesen werden.

Siehe auch

Personal tools