Help - Search - Members - Calendar
Full Version: Delphi/PASCAL - Extended to integer ?
Pixel2Life Forum > Help Section > Desktop Programming
goaliemike
Hi, ive been working on Delphi for my school's programming course. We have to create a game out of stuff we learned, tho its not the best to use its still fun. Now im stuck with a extended variable that i need to convert into a integer. I have looked for a while, the best i found is that a extended variable is a longer integer... How can i convert it ?
U1
Something like this:

int x = 10;

String s = new Integer(x).toString();
Or
String.valueOf(x);


Edit: ^^ nvm that was my java snipits rolleyes.gif
erpizn13
Hey, I'm probably late, but did not see answer to your qtn, so here is my post!

Type-cast:
var
x: Extended;
y: Integer;
...
y := Integer(x);

Round/Ceil/Floor:
var
x: Extended;
y: Integer;
...
y := Round(x); //uses System
y := Ceil(x); //uses Math
y := Floor(x); //uses Math

-erpizn13
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.