Autor Beitrag
Killi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 299

Win*
D6 Prof
BeitragVerfasst: Do 16.01.03 20:43 
Hi!

Wie kann ich eine Real-Zahl in ein Integer o. in einen String umwandeln o. ihn dafür verwenden???
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 16.01.03 20:48 
FloatToStr/StrToFloat macht das gewünschte mit einem String
Für die Integer-Variante such mal in der Hilfe nach Round und den dazugehörigen "see also's", also allem, was laut Borland so dazu gehört.
Du weißt aber, das es immer ungenauigkeiten gibt, wenn man einen Real in einen Integer umwandelt? Alles hinter dem Komma gibt's nicht mehr.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Do 16.01.03 20:49 
Real in String:
ausblenden Quelltext
1:
floattostr(realvariable);					

real in integer:
geht ncicht, da real dezimalzahlen hat und integer nicht
--> runden:
ausblenden Quelltext
1:
2:
3:
intvariable:=round(floatvar);

Fiji-Fighter