---
title: FloatingPointRoundingRule.awayFromZero
framework: swift
role: symbol
role_heading: Case
path: swift/floatingpointroundingrule/awayfromzero
---

# FloatingPointRoundingRule.awayFromZero

Round to the closest allowed value whose magnitude is greater than or equal to that of the source.

## Declaration

```swift
case awayFromZero
```

## Discussion

Discussion The following example shows the results of rounding numbers using this rule: (5.2).rounded(.awayFromZero) // 6.0 (5.5).rounded(.awayFromZero) // 6.0 (-5.2).rounded(.awayFromZero) // -6.0 (-5.5).rounded(.awayFromZero) // -6.0
