Autor Beitrag
Ken-san
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78

WIN: XP, 2000 LINUX: SUSE
Pascal, Delphi 5 Prof, C, C++
BeitragVerfasst: Di 03.02.04 18:05 
Hallo

Ich habe ein Problem wie folgt:
Ich möchte einen Preis runden natürlich auf zwei Nachkommastellen wie geht das ich habe mich schon über die Round funktion kundig gemacht aber mit der selbigen funktioniert es nicht wäre cool wenn mir da jemand schnell helfen könnte

Kenny

_________________
SNAFU: Same Normal All f*** Up
MaxiTB
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 679

Win2000, WinXp, Workbench ;-)
D7 Ent, VS2003 Arch.
BeitragVerfasst: Di 03.02.04 18:22 
Simpel:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
function Round2(Value: Extended): Extended;
begin
 Result:=Round(Value*100)/100;
end;

_________________
Euer Mäxchen
Wer früher stirbt, ist länger tot.
Ken-san Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78

WIN: XP, 2000 LINUX: SUSE
Pascal, Delphi 5 Prof, C, C++
BeitragVerfasst: Mi 04.02.04 07:38 
Ich danke dir für die Hilfe es funzt (hab auch nichts anderes erwartet) :D

Kenny

_________________
SNAFU: Same Normal All f*** Up
Phantom1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 390



BeitragVerfasst: Mi 04.02.04 09:07 
Noch einfacher ist es die schon vorhandene Function RoundTo() zu benutzen :wink: Die Unit Math muss dazu eingebunden werden.
Nac-Hac
Hält's aus hier
Beiträge: 11

WIN XP Home
D6
BeitragVerfasst: So 05.12.04 14:52 
MaxiTB hat folgendes geschrieben:
Simpel:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
function Round2(Value: Extended): Extended;
begin
 Result:=Round(Value*100)/100;
end;


hab das gleiche problem

aber wo muss ich das einsetzen?

beispielsweise will ich das ergebnis von c:=a/b; auf 2 nachkommastellen runden
wie mache ich das?
Nac-Hac
Hält's aus hier
Beiträge: 11

WIN XP Home
D6
BeitragVerfasst: Mo 06.12.04 15:44 
wäre nett wenn einer antwortet :wink: