Str/de
From Free Pascal wiki
Jump to navigationJump to search
│
Deutsch (de) │
English (en) │
русский (ru) │
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.

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.