These constants are used to specify how numbers should be rounded. These constants are used by the roundingMode property.


enum RoundingMode : UInt



case ceiling

Round towards positive infinity.

case floor

Round towards negative infinity.

case down

Round towards zero.

case up

Round away from zero.

case halfEven

Round towards the nearest integer, or towards an even number if equidistant.

case halfDown

Round towards the nearest integer, or towards zero if equidistant.

case halfUp

Round towards the nearest integer, or away from zero if equidistant.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software