math.round

Rounds a number to the nearest integer.

Usage

math.round(value)

Arguments

Name Type Description
value number Value to round.

Returns

Name Type Description
rounded number Rounded value.

Examples

local rounded = math.round(6.8);
print(rounded); -- Prints "7"

This site uses Just the Docs, a documentation theme for Jekyll.