<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFStringCompareFlags/compareNumerically",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@E@CFStringCompareFlags@kCFCompareNumerically"
  },
  "title" : "compareNumerically"
}
-->

# compareNumerically

Specifies that represented numeric values should be used as the basis for comparison and not the actual character values.

```
static var compareNumerically: CFStringCompareFlags { get }
```

## Discussion

For example, “version 2” is less than “version 10”.

This comparison does not work if `kCFCompareLocalized` is specified on systems before OS X v10.3.

---

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)