<!--
{
  "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/TimeFormatStyle/Pattern-swift.struct/minuteSecond(padMinuteToLength:fractionalSecondsLength:roundFractionalSeconds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s8DurationV10FoundationE15TimeFormatStyleV7PatternV12minuteSecond17padMinuteToLength017fractionalSecondsL0015roundFractionalN0AGSi_Sis25FloatingPointRoundingRuleOtFZ"
  },
  "title" : "minuteSecond(padMinuteToLength:fractionalSecondsLength:roundFractionalSeconds:)"
}
-->

# minuteSecond(padMinuteToLength:fractionalSecondsLength:roundFractionalSeconds:)

Returns a pattern to format a duration with minutes and seconds only, with the given unit configurations.

```
static func minuteSecond(padMinuteToLength: Int, fractionalSecondsLength: Int = 0, roundFractionalSeconds: FloatingPointRoundingRule = .toNearestOrEven) -> Duration.TimeFormatStyle.Pattern
```

## Parameters

`padMinuteToLength`

Padding for the minute field. For example, setting this value to `2` formats five minutes as `05:00` in the `en_US` locale.

`fractionalSecondsLength`

The length of the fractional seconds. For example, setting this value to `2` formats five minutes as `5:00.00` in the `en_US` locale.

`roundFractionalSeconds`

The rule to use for rounding the seconds value, given the remaining fractional seconds value. Use one of the cases from the [`FloatingPointRoundingRule`](/documentation/Swift/FloatingPointRoundingRule) enumeration.

## Return Value

A [`Duration.TimeFormatStyle.Pattern`](/documentation/Swift/Duration/TimeFormatStyle/Pattern-swift.struct) that formats a duration with minutes and seconds, using the given unit configurations.

---

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)