Autor Beitrag
Jazzalex
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

Fedora Core 3, Winx XP

BeitragVerfasst: Di 27.03.07 08:12 
Hallo allerseits,

ich habe mehrere TEdit-Felder und moechte in denen einen Double-Wert darstellen, der auf 2 Nachkommastellen gerundet ist. Wie kann ich auf einfachste Weise diese Rundung durchfuehren ?

Dank im voraus, Gruesse

-- A l e x
ene
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 779
Erhaltene Danke: 1

Vista, XP, W2K
Delphi, .Net, Deutsch und Englisch
BeitragVerfasst: Di 27.03.07 08:25 
Hi,

(Round(Zahl*100))/100 sollte doch reichen?
Jazzalex Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

Fedora Core 3, Winx XP

BeitragVerfasst: Di 27.03.07 08:36 
danke, das Problem ist nur, dass auf diese Art nicht genau auf 2 Stellen nach dem Komma gerundet wird. Ich habe halt dieses Format :

xyz,abcdefg oder noch mehr Nachkommastellen und will dieses Format haben :

xyz,ab

eine Idee ?

Danke

-- A l e x
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Di 27.03.07 08:38 
ausblenden Delphi-Quelltext
1:
Edit1.Text := FloatToStrf(FloatWert, fffixed, 10, 2);					


Bei weiteren Fragen, bitte die Hilfe benutzen. ;)

MfG
freak

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Di 27.03.07 08:43 
Benutz doch
ausblenden Delphi-Quelltext
1:
Format('%.2f', [dWert])					



MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
Jazzalex Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 25

Fedora Core 3, Winx XP

BeitragVerfasst: Di 27.03.07 08:55 
Danke, Freak !