CRect:Ceil


The Ceil method rounds all 4 rectangle limits to the next higher integer value. For example xmax=100.54 becomes xmax=101.

Syntax

CRect:Ceil()

  

This method rounds all 4 rectangle limits to the next higher integer values. Compare with the Round and Floor methods.

Example

The following script creates a CRect object and shows its values before and after using the Ceil method.

R = NewRect( 383.43,502.14,603.43,554.83 )

-- Create a CRect

Printf("%lg %lg, %lg %lg", R:Get() )

-- result: 383.43 502.14, 603.43 554.83

R:Ceil()

-- round down to integer values

Printf("%lg %lg, %lg %lg", R:Get() )

-- result: 384 503, 604 555

Related Topics

Round

Floor

Get

CRect class