Autor Beitrag
LLiinnuuxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20

Windows: XP;98 Linux(Suse):6.2;9.0
D3; D6
BeitragVerfasst: Mo 07.06.04 15:24 
Ich müsste einen Integer wert in einen Extended formatieren da ich aus ihm die Wurzel ziehen will (sqrt(zahl: extended)).
und das ganze nacher wieder nach integer wandeln?!

:?:

Würde mich freuen wenn mir jemand bei diesem Prob helfen könnte.
Ich weiß nicht die Funktion kann ja nicht so schwer sein.
Ich finde einfach nichts!

Danke für eure Hilfe jetzt schon einmal! :)


Moderiert von user profile iconPeter Lustig: Topic aus Sonstiges verschoben am Do 10.06.2004 um 19:18
LLiinnuuxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20

Windows: XP;98 Linux(Suse):6.2;9.0
D3; D6
BeitragVerfasst: Mo 07.06.04 15:51 
Für alle die es interessiert und es in diesem Forum suchen habe grade die antwort für das umgekehrt gefunden mich interessiert aber eigentlich das andere, wenn es jemand weiß schnell posten!

Extended nach Integer:

round(Extended):longinteger; :idea:

Bitte helft mir!!!

Kann ja nicht so schwer sein
Goolix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 83



BeitragVerfasst: Mo 07.06.04 16:09 
naja, falls du keine bessere lösung findest, dann wandle doch einfach in 2zügen um:

inttostr
und anschließend
strtofloat

habs zwar nicht probiert, sollte aber zumindest von integer zu extended funzen, umgekehrt weiß ich nicht...

/gool
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Mo 07.06.04 16:14 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.Button1Click(Sender: TObject);
var
  a: Integer;
  b: Extended;
begin
  a := 55555;
  ShowMessage(IntToStr(a));

  b := a;
  b := b / 3;
  ShowMessage(FloatToStr(b));

  a := Trunc(b);
  ShowMessage(IntToStr(a));
end;

_________________
Gruß
Martin
LLiinnuuxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 20

Windows: XP;98 Linux(Suse):6.2;9.0
D3; D6
BeitragVerfasst: Do 10.06.04 18:13 
Danke für eure Antworten!
TomT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 116

Suse 9.1 WinXP
D6 Pers
BeitragVerfasst: Do 10.06.04 22:10 
Oder einfach:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Button1Click(Sender: TObject); 
var 
  a: Integer; 
begin 
  a := 55555; 
  a := Round(sqrt(a)); 
end;

_________________
...und da wurde mir klar, dass eine Toolbar keine Kneipe für Heimwerker ist.