Xojo.Math.Round

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

Xojo.Math.Round(value As Double) As Double

Supported for all project types and targets.

Returns the value rounded to the nearest whole number.

Sample Code

Some rounding examples:

Using Xojo.Math

Dim d As Double
d = Round(1.499) // d = 1
d = Round(1.500) // d = 2
d = Round(1.1) // d = 1
d = Round(1.7) // d = 2