Rounds the value to an integral value using the specified rounding rule.
- Xcode 8.0+
- Swift Standard Library
The rounding rule to use.
The following example rounds a value using four different rounding rules:
For more information about the available rounding rules, see the
Floating enumeration. To round a value using the default “schoolbook rounding”, you can use the shorter
round() method instead.