Autor Beitrag
PrP
Hält's aus hier
Beiträge: 4



BeitragVerfasst: Fr 02.11.07 13:06 
Hi!

Ich bin noch ziemlich schlecht, was das Programmieren mit Delphi betrifft, deswegen habe ich folgende Frage:

Gibt es irgendeinen Befehl, der, z.B statt 10000, 10.000 schreibt.
Ich arbeite nämlich gerade an einem Umrechner, der unter anderem Kilometer in Mikrometer umwandelt und da kommen halt oft ziemlich große Zahlen heraus, die nicht so übersichtlich sind.

Kann mir da irgendwer helfen?
Schonmal danke...

LG
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Fr 02.11.07 13:32 
Der Befehrl, den du brauchst, heisst Format.

_________________
Bravery calls my name in the sound of the wind in the night...
PrP Threadstarter
Hält's aus hier
Beiträge: 4



BeitragVerfasst: Fr 02.11.07 14:06 
Und wie muss ich den anwenden?
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Fr 02.11.07 14:10 
Kennst du die Delphi-Hilfe? Also ich habe mal das Beispiel aus der Help kopiert:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
procedure TForm1.Save1Click(Sender: TObject);

var
  NewFileName: string;
  Msg: string;
  NewFile: TFileStream;
  OldFile: TFileStream;
begin
  NewFileName := ExtractFilePath(Application.ExeName) + ExtractFileName(Edit1.Text);
  Msg := Format('Copy %s to %s?', [Edit1.Text, NewFileName]);
  if MessageDlg(Msg, mtCustom, mbOKCancel, 0) = mrOK then
  begin
    OldFile := TFileStream.Create(Edit1.Text, fmOpenRead or fmShareDenyWrite);
    try
      NewFile := TFileStream.Create(NewFileName, fmCreate or fmShareDenyRead);

      try
        NewFile.CopyFrom(OldFile, OldFile.Size);
      finally
        FreeAndNil(NewFile);
      end;
    finally
      FreeAndNil(OldFile);
    end;
  end;

end;
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 02.11.07 14:33 
user profile iconPrP hat folgendes geschrieben:
Und wie muss ich den anwenden?
Wie wäre es mit etwas Eigeninitiative...
Suche bei Google DELPHI FORMAT liefert z.B. als zweites Ergebnis:
www.dsdt.info/tipps/?id=151