Dark Bit Factory & Gravity
ARCHIVE => Archive => Cobra => Topic started by: Clyde on January 11, 2007
-
Hiya,
Is there a way to convert a real number to the nearest Integer?
In Blitz it would be:
Value=Int(Abs(vbtz(a)))
Cheers and many thanks,
Clyde.
-
if "value" is an integer it will autoconvert.
if value is a real, there are a few ways.
1. value = round(abs(a),0) // round to 0 decimal places, you can round to any number of places
2. value = floor(a) // always round down
3. value = ceil(a) // always round up
-
Smart stuff and thanks dude.
Cheers and all the best,
Clyde.