CPoint:Round
The Round method replaces the x and y members of the CPoint with the nearest integer value. For example, x=1.8 rounds up to x=2, and x=-16.8 rounds down to x=-17.
P = CPoint:Round() P returned is the original CPoint object. This allows the Round method to be used as part of an operator expression, if desired. On failure, nil is returned. |
The following script creates a CPoint object and applies the Round method to its values.
|
-- create a CPoint object |
|
-- result: x=4.4, y=-13.2 |
|
-- compute the rounded values |
|
-- result: x=4, y=-13 |
CPoint class, Ceil, Floor, CPoint Math Operators
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.