Str/de
Str
Beschreibung
Mit Str, kann man einen numerischen Wert in einen String konvertieren. Es ist sogar mittels : Breite: Dezimal eine Formatierung des Stringes möglich, siehe Beispiel.
Note: Bei Float-Typen muss beachtet werden, das immer ein Punkt als Dezimaltrenner ausgegeben wird, egal wie die Ländereinstellungen des OS eingestellt sind.
Beispiel
var
s: string;
i: integer;
f: single;
begin
i := 123;
Str(i, s); // ohne Formatierung
WriteLn(s);
Str(i: 8, s); // String formatieren
WriteLn(s);
f := 123.456;
Str(f, s); // ohne Formatierung
WriteLn(s);
Str(f: 8: 4, s); // String formatieren
WriteLn(s);
Str(f: 8, s); // String als komplettes formatieren
WriteLn(s);
end.Siehe auch:
- Val - String in numerischen Wert konvertieren.
From the Free Pascal wiki, page "Str/de", as it stood on 2020-02-28 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
