---
title: "CFNumberFormatterGetValueFromString(_:_:_:_:_:)"
framework: Core Foundation
role: symbol
role_heading: Function
path: "corefoundation/cfnumberformattergetvaluefromstring(_:_:_:_:_:)"
---

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

Returns a number or value representing a given string.

## Declaration

```swift
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 doc://com.apple.corefoundation/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

Return Value true if the string was parsed successfully, otherwise false.

## See Also

### Formatting Values

- [CFNumberFormatterCreateNumberFromString(_:_:_:_:_:)](corefoundation/cfnumberformattercreatenumberfromstring(_:_:_:_:_:).md)
- [CFNumberFormatterCreateStringWithNumber(_:_:_:)](corefoundation/cfnumberformattercreatestringwithnumber(_:_:_:).md)
- [CFNumberFormatterCreateStringWithValue(_:_:_:_:)](corefoundation/cfnumberformattercreatestringwithvalue(_:_:_:_:).md)
- [CFNumberFormatterGetDecimalInfoForCurrencyCode(_:_:_:)](corefoundation/cfnumberformattergetdecimalinfoforcurrencycode(_:_:_:).md)
