'round' Numeric Class[Resolved]

Started by Apidcloud, May 07, 2011, 02:14:42 pm

Previous topic - Next topic

Apidcloud

May 07, 2011, 02:14:42 pm Last Edit: May 08, 2011, 07:05:31 am by Apidcloud
Hey XD

How do I use 'round' ? xD It's from Numeric class...
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit

ForeverZer0

float = 1.4
print float.round


1

float = 3452.6
print float.round


3453

Their are also ".ceil" and ".floor". .ceil will always round up to the next nearest whole integer, whil .floor always round down.
.round and .to_i are basically the same thing, they round down for decimal value less than .5, and up for .5 and greater.


I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Apidcloud

Big thanks xD

Thanks a lot for helping me (:

Resolved :P
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit