<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/TypeDisplayRepresentation/numericFormat",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents25TypeDisplayRepresentationV13numericFormat10Foundation23LocalizedStringResourceVSgvp"
  },
  "title" : "numericFormat"
}
-->

# numericFormat

A string representing a count for the type, e.g. “2 books”.

```
var numericFormat: LocalizedStringResource?
```

## Discussion

In your `numericFormat` implementation, use `StringInterpolation` placeholders and provide a
`.stringsdict` file with all possible pluralizations for the type, such as “0 books”, “1 book”,
and “2 books”.

Example:

```
TypeDisplayRepresentation(
    name: LocalizedStringResource("Book"),
    numericFormat: LocalizedStringResource("\(placeholder: .int) books")
)
```

```
<dict>
   <key>Book</key>
   <dict>
     <key>NSStringLocalizedFormatKey</key>
     <string>%#@VARIABLE@</string>
     <key>VARIABLE</key>
     <dict>
       <key>NSStringFormatSpecTypeKey</key>
       <string>NSStringPluralRuleType</string>
       <key>one</key>
       <string>Book</string>
       <key>other</key>
       <string>Books</string>
     </dict>
   </dict>
   <key>%lld books</key>
   <dict>
     <key>NSStringLocalizedFormatKey</key>
     <string>%#@count@</string>
     <key>count</key>
     <dict>
       <key>NSStringFormatSpecTypeKey</key>
       <string>NSStringPluralRuleType</string>
       <key>NSStringFormatValueTypeKey</key>
       <string>lld</string>
       <key>zero</key>
       <string>%lld books</string>
       <key>one</key>
       <string>%lld book</string>
       <key>other</key>
       <string>%lld books</string>
     </dict>
   </dict>
 </dict>
```

---

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)