Jump to content
Sign in to follow this  
LightWalker

integer

Recommended Posts

Anyone have an idea on how to make a number integer in ofp. Or at least a number with no more than 2 decimals?

Share this post


Link to post
Share on other sites

From OFPEC...

Quote[/b] ]You can use mod to round a decimal number down to the nearest whole number. For example, if you wanted to use the command random to generate a whole number between 0 and 6 you could put this in a script:-

_rand = random 6

_num = _rand - (_rand mod 1)

Share this post


Link to post
Share on other sites

or...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_r = random 6

_r = _r - _r % 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×