Autor Beitrag
Karstadt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 174

Windows 2000 / XP
Delphi 7 Pro
BeitragVerfasst: Mo 10.10.05 11:43 
Hallo. Ich möchte eine Zahl z.b 12,3 so formatieren damit es 12,30 wird.

Ich habe mir die Funktion "FORMAT" in Hilfe angeschaut, bin aber nicht schlauer geworden. Kann mir bitte jemand helfen?

Moderiert von user profile iconraziel: Topic als erledigt markiert.
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Mo 10.10.05 11:52 
function FormatFloat(const Format: string; Value: Extended): string;

Setze den DM Wert als Float dann kannst du ihn einfach formatieren und als String ausgeben.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
  test: double;
begin
  test := 12.3;

  Edit1.Text := FormatFloat('00.00', test);


Ergebnis wäre dann 12,30

Hoffe das hilft weiter..

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.
Karstadt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 174

Windows 2000 / XP
Delphi 7 Pro
BeitragVerfasst: Mo 10.10.05 12:39 
Danke das ist DIE Lösung! ;)