---
title: CFNumberFormatter
framework: Core Foundation
role: symbol
role_heading: Class
path: corefoundation/cfnumberformatter
---

# CFNumberFormatter

## Declaration

```swift
class CFNumberFormatter
```

## Overview

Overview CFNumberFormatter objects format the textual representations of CFNumber objects, and convert textual representations of numbers into CFNumber objects. The representation encompasses integers, floats, and doubles; floats and doubles can be formatted to a specified decimal position. You specify how strings are formatted and parsed by setting a format string and other properties of a CFNumberFormatter object. The format of the format string is defined by Unicode Technical Standard #35; the version of the standard used varies with release of the operating system, and is described in Introduction to Data Formatting Programming Guide For Cocoa. important: CFNumberFormatter is not thread-safe.  Do not use a single instance from multiple threads. Unlike some other Core Foundation opaque types with names similar to a corresponding Cocoa Foundation class (such as CFString and NSString), CFNumberFormatter objects cannot be cast (“toll-free bridged”) to NSNumberFormatter objects.

## Topics

### Creating a Number Formatter

- [CFNumberFormatterCreate(_:_:_:)](corefoundation/cfnumberformattercreate(_:_:_:).md)

### Configuring a Number Formatter

- [CFNumberFormatterSetFormat(_:_:)](corefoundation/cfnumberformattersetformat(_:_:).md)
- [CFNumberFormatterSetProperty(_:_:_:)](corefoundation/cfnumberformattersetproperty(_:_:_:).md)

### Formatting Values

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

### Examining a Number Formatter

- [CFNumberFormatterCopyProperty(_:_:)](corefoundation/cfnumberformattercopyproperty(_:_:).md)
- [CFNumberFormatterGetFormat(_:)](corefoundation/cfnumberformattergetformat(_:).md)
- [CFNumberFormatterGetLocale(_:)](corefoundation/cfnumberformattergetlocale(_:).md)
- [CFNumberFormatterGetStyle(_:)](corefoundation/cfnumberformattergetstyle(_:).md)

### Getting the CFNumberFormatter Type ID

- [CFNumberFormatterGetTypeID()](corefoundation/cfnumberformattergettypeid().md)

### Data Types

- [CFNumberFormatterStyle](corefoundation/cfnumberformatterstyle.md)
- [CFNumberFormatterOptionFlags](corefoundation/cfnumberformatteroptionflags.md)
- [CFNumberFormatterPadPosition](corefoundation/cfnumberformatterpadposition.md)

### Constants

- [Number Formatter Styles](corefoundation/number-formatter-styles.md)
- [Number Formatter Property Keys](corefoundation/number-formatter-property-keys.md)
- [Number Format Options](corefoundation/number_format_options.md)
- [CFNumberFormatterRoundingMode](corefoundation/cfnumberformatterroundingmode.md)
- [Padding Positions](corefoundation/padding-positions.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)

## See Also

### Related Documentation

- [Data Formatting Guide for Core Foundation](apple-archive/documentation/CoreFoundation/Conceptual/CFDataFormatting/Articles/CFDataFormatting.html.md)

### Opaque Types

- [CFAllocator](corefoundation/cfallocator.md)
- [CFArray](corefoundation/cfarray.md)
- [CFAttributedString](corefoundation/cfattributedstring.md)
- [CFBag](corefoundation/cfbag.md)
- [CFBinaryHeap](corefoundation/cfbinaryheap.md)
- [CFBitVector](corefoundation/cfbitvector.md)
- [CFBoolean](corefoundation/cfboolean.md)
- [CFBundle](corefoundation/cfbundle.md)
- [CFCalendar](corefoundation/cfcalendar.md)
- [CFCharacterSet](corefoundation/cfcharacterset.md)
- [CFData](corefoundation/cfdata.md)
- [CFDate](corefoundation/cfdate.md)
- [CFDateFormatter](corefoundation/cfdateformatter.md)
- [CFDictionary](corefoundation/cfdictionary.md)
- [CFError](corefoundation/cferror.md)
