CPoint:Round
The Round method rounds both x and y properties to the nearest integer value. For example P.x=100.54 becomes P.x=101 , and P.x=100.49 becomes P.x=100. This method uses the Round function.
CRect:Round() |
The following script returns the values of a point before and after being rounded:
|
-- Create a CPoint |
|
-- result: 50.322, 100.55 |
|
-- round to integer values |
|
-- result: 50, 101 |