Math.round

From GiderosMobile

Available since: Gideros 2022.1
Class: math

Description

Returns the integer with the smallest difference between it and the given number.

(number) = math.round(v)

For example, the value 5.8 returns 6.

For values like 0.5 that are equidistant to two integers, the value with the greater difference between it and zero is chosen. In other words, the function rounds away from zero: 0.5 rounds to 1; -0.5 rounds to -1.

Parameters

v: (number) value to round

Return values

Returns (number) rounding result