<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NumberFormatter/usesSignificantDigits",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSNumberFormatter(py)usesSignificantDigits"
  },
  "title" : "usesSignificantDigits"
}
-->

# usesSignificantDigits

A Boolean value indicating whether the formatter uses minimum and maximum significant digits when formatting numbers.

```
var usesSignificantDigits: Bool { get set }
```

## Discussion

The [`NumberFormatter`](/documentation/Foundation/NumberFormatter) class has two ways of determining how many digits to represent:_ _using integer and fraction digits and using significant digits.

When this property is set to <doc://com.apple.documentation/documentation/Swift/false>, numbers are formatted according to whether you want them formatted as fractions or as integers. For more information, see Configuring Integer and Fraction Digits. This property is <doc://com.apple.documentation/documentation/Swift/false> by default.

Set this property to <doc://com.apple.documentation/documentation/Swift/true> to format numbers according to the significant digits configuration specified by the [`minimumSignificantDigits`](/documentation/Foundation/NumberFormatter/minimumSignificantDigits) and [`maximumSignificantDigits`](/documentation/Foundation/NumberFormatter/maximumSignificantDigits) properties. By default, the minimum number of significant digits is 1, and the maximum number of significant digits is 6.

> Note:
> When a number formatter is configured to use significant digits, it ignores any minimum or maximum values used to set integer or fraction digits.

The following code demonstrates the effect of configuring [`usesSignificantDigits`](/documentation/Foundation/NumberFormatter/usesSignificantDigits) when formatting various numbers:

```swift
var numberFormatter = NumberFormatter()

// Using significant digits
numberFormatter.usesSignificantDigits = true
numberFormatter.string(from: 12345678) // 12345700
numberFormatter.string(from: 1234.5678) // 1234.57
numberFormatter.string(from: 100.2345678) // 100.235
numberFormatter.string(from: 1.230000) // 1.23
numberFormatter.string(from: 0.00000123) // 0.00000123

// Using integer and fraction digits
numberFormatter.usesSignificantDigits = false
numberFormatter.string(from: 12345678) // 12345678
numberFormatter.string(from: 1234.5678) // 1235
numberFormatter.string(from: 100.2345678) // 100
numberFormatter.string(from: 1.230000) // 1
numberFormatter.string(from: 0.00000123) // 0
```

---

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)