---
title: Duration.UnitsFormatStyle.FractionalPartDisplayStrategy
framework: swift
role: symbol
role_heading: Structure
path: swift/duration/unitsformatstyle/fractionalpartdisplaystrategy
---

# Duration.UnitsFormatStyle.FractionalPartDisplayStrategy

A strategy that determines how to format the fractional part of a duration if the allowed units can’t represent it exactly.

## Declaration

```swift
struct FractionalPartDisplayStrategy
```

## Overview

Overview When using a Duration.UnitsFormatStyle, specifying a FractionalPartDisplayStrategy enables you to decide how to balance between accuracy and verbosity when you’re not using all of the available units (hours, minutes, and seconds). When a formatted duration has a fractional part, you can hide it entirely, round the unit up or down while hiding the fractional part, or show the unit with a fraction. The following example shows different display strategies used with a duration of 1 hour, 15 minutes and unit format styles that only show hours. let duration = Duration.seconds(75 * 60) // 1 minute, 15 seconds let hide = duration.formatted(     .units(allowed: [.hours],            width: .wide,            fractionalPart: .hide)) // 1 hour let hideRounded = duration.formatted(     .units(allowed: [.hours],            width: .wide,            fractionalPart: .hide(rounded:.up))) // 2 hours let show = duration.formatted(     .units(allowed: [.hours],            width: .wide,            fractionalPart: .show(length: 2))) // 1.25 hours

## Topics

### Creating a fractional part display strategy

- [init(lengthLimits:roundingRule:roundingIncrement:)](swift/duration/unitsformatstyle/fractionalpartdisplaystrategy/init(lengthlimits:roundingrule:roundingincrement:).md)

### Using common strategies

- [hide](swift/duration/unitsformatstyle/fractionalpartdisplaystrategy/hide.md)
- [hide(rounded:)](swift/duration/unitsformatstyle/fractionalpartdisplaystrategy/hide(rounded:).md)
- [show(length:rounded:increment:)](swift/duration/unitsformatstyle/fractionalpartdisplaystrategy/show(length:rounded:increment:).md)

### Working with strategy properties

- [minimumLength](swift/duration/unitsformatstyle/fractionalpartdisplaystrategy/minimumlength.md)
- [maximumLength](swift/duration/unitsformatstyle/fractionalpartdisplaystrategy/maximumlength.md)
- [roundingIncrement](swift/duration/unitsformatstyle/fractionalpartdisplaystrategy/roundingincrement.md)
- [roundingRule](swift/duration/unitsformatstyle/fractionalpartdisplaystrategy/roundingrule.md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Working with fractional values

- [fractionalPartDisplay](swift/duration/unitsformatstyle/fractionalpartdisplay.md)
