<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFNumberFormatterGetValueFromString(_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFNumberFormatterGetValueFromString"
  },
  "title" : "CFNumberFormatterGetValueFromString(_:_:_:_:_:)"
}
-->

# CFNumberFormatterGetValueFromString(_:_:_:_:_:)

Returns a number or value representing a given string.

```
func CFNumberFormatterGetValueFromString(_ formatter: CFNumberFormatter!, _ string: CFString!, _ rangep: UnsafeMutablePointer<CFRange>!, _ numberType: CFNumberType, _ valuePtr: UnsafeMutableRawPointer!) -> Bool
```

## Parameters

`formatter`

The number formatter to use.

`string`

The string to parse.

`rangep`

A reference to a range that specifies the substring of  `string` to be parsed. If `NULL`, the whole string is parsed. Upon return, contains the range of the actual extent of the parse (may be less than the given range).

`numberType`

The type of value that `valuePtr` references. Valid values are listed in [`CFNumberType`](/documentation/CoreFoundation/CFNumberType).

`valuePtr`

Upon return, contains a number or value representing the string in the specified format. You are responsible for releasing this value.

## Return Value

`true` if the string was parsed successfully, otherwise `false`.

---

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)