floor

From RPTools Wiki
Revision as of 17:00, 14 March 2023 by Taustin (talk | contribs) (Text replacement - "source>" to "syntaxhighlight>")
Jump to navigation Jump to search

floor() Function

Returns the number padded in if it is an integer, otherwise the number is rounded down to the nearest smaller integer and that value is returned.

Usage

<source lang="mtmacro" line> [h: result = floor(num)] </syntaxhighlight>

Examples

<source lang="mtmacro" line>

[r: floor(2)] </syntaxhighlight> Returns 2.

<source lang="mtmacro" line> [r: floor(1.2)] </syntaxhighlight> Returns 1.

<source lang="mtmacro" line> [r: floor(-1.2)] </syntaxhighlight>

Returns -2.