$int

From Scriptwiki
Revision as of 17:48, 18 October 2005 by Albie (talk | contribs) (Added example to return remainder)

Jump to: navigation, search

Returns the specified integer number without rounding.

$int(N)
  • N is the number with decimals you want to handle.

Examples

$int($pi) - will return 3
$int(9312412.3213) - will return 9312412
var %i = 2.5
$calc(%i - %int(%i)) - will return 0.5

The above example shows how to return the remainder from a decimal number.

See also

$round, $ceil and $floor.