<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Duration/UnitsFormatStyle/FractionalPartDisplayStrategy/init(lengthLimits:roundingRule:roundingIncrement:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s8DurationV10FoundationE16UnitsFormatStyleV29FractionalPartDisplayStrategyV12lengthLimits12roundingRule0L9IncrementAGx_s021FloatingPointRoundingM0OSdSgtcSXRzSi5BoundRtzlufc"
  },
  "title" : "init(lengthLimits:roundingRule:roundingIncrement:)"
}
-->

# init(lengthLimits:roundingRule:roundingIncrement:)

Creates a fractional part display strategy that uses the provided behaviors.

```
init<Range>(lengthLimits: Range, roundingRule: FloatingPointRoundingRule = .toNearestOrEven, roundingIncrement: Double? = nil) where Range : RangeExpression, Range.Bound == Int
```

## Parameters

`lengthLimits`

The maximum string length of the fractional part.

`roundingRule`

A rule for rounding fractional values up or down. Defaults to [`FloatingPointRoundingRule.toNearestOrEven`](/documentation/Swift/FloatingPointRoundingRule/toNearestOrEven).

`roundingIncrement`

A multiple by which the formatter rounds the fractional part. The formatter produces a value that is an even multiple of this increment. If this parameter is `nil` (the default), the formatter doesn’t apply an increment. This value is only meaningful when the combination of allowed units, rounding rule, and formatting strategy requires expressing a unit with a fractional part. For example, a formatter that only allows minutes and uses a strategy with a length of `2` and default rounding rule formats 40 seconds as `0.67 minutes`. With a `roundingIncrement` of `0.05`, the formatter formats this value as `0.65 minutes` instead.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)