---
title: Data Formatting
framework: foundation
role: collectionGroup
role_heading: API Collection
path: foundation/data-formatting
---

# Data Formatting

Convert numbers, dates, measurements, and other values to and from locale-aware string representations.

## Overview

Overview Foundation supports two approaches for data formatting: When working in Swift, use formatted methods directly on the types you want to format, optionally using FormatStyle and its subtypes to customize formatter output. This approach supports dates, integers, floating-point numbers, measurements, sequences, and person name components. Foundation caches identically-configured formatter instances internally, allowing you to focus on your app’s formatting needs. In Objective-C, create instances of Formatter and its subtypes, and use the string(for:) method to convert objects to formatted strings.

## Topics

### Essentials

- [Building a Localized Food-Ordering App](foundation/building-a-localized-food-ordering-app.md)
- [Displaying Human-Friendly Content](foundation/displaying-human-friendly-content.md)

### Data formatting in Swift

- [Language Introspector](foundation/language-introspector.md)
- [FormatStyle](foundation/formatstyle.md)
- [IntegerFormatStyle](foundation/integerformatstyle.md)
- [FloatingPointFormatStyle](foundation/floatingpointformatstyle.md)
- [Decimal.FormatStyle](foundation/decimal/formatstyle.md)
- [ListFormatStyle](foundation/listformatstyle.md)
- [StringStyle](foundation/stringstyle.md)
- [URL.FormatStyle](foundation/url/formatstyle.md)
- [FormatStyleCapitalizationContext](foundation/formatstylecapitalizationcontext.md)
- [Format Style Configurations](foundation/format-style-configurations.md)

### Data parsing in Swift

- [ParseableFormatStyle](foundation/parseableformatstyle.md)
- [ParseStrategy](foundation/parsestrategy.md)
- [IntegerParseStrategy](foundation/integerparsestrategy.md)
- [FloatingPointParseStrategy](foundation/floatingpointparsestrategy.md)
- [Decimal.ParseStrategy](foundation/decimal/parsestrategy.md)

### Numbers and currency

- [NumberFormatter](foundation/numberformatter.md)

### Names

- [PersonNameComponentsFormatter](foundation/personnamecomponentsformatter.md)
- [PersonNameComponents](foundation/personnamecomponents.md)

### Dates and times

- [DateFormatter](foundation/dateformatter.md)
- [DateComponentsFormatter](foundation/datecomponentsformatter.md)
- [RelativeDateTimeFormatter](foundation/relativedatetimeformatter.md)
- [DateIntervalFormatter](foundation/dateintervalformatter.md)
- [ISO8601DateFormatter](foundation/iso8601dateformatter.md)

### Data sizes

- [ByteCountFormatter](foundation/bytecountformatter.md)

### Measurements

- [MeasurementFormatter](foundation/measurementformatter.md)

### Lists

- [ListFormatter](foundation/listformatter.md)

### Internationalization

- [Locale](foundation/locale.md)

### Custom formatters

- [Formatter](foundation/formatter.md)

### Automatic grammar agreement

- [InflectionRule](foundation/inflectionrule.md)
- [Morphology](foundation/morphology.md)
- [TermOfAddress](foundation/termofaddress.md)
- [InflectionConcept](foundation/inflectionconcept.md)
- [Morphology.Pronoun](foundation/morphology/pronoun.md)

### Deprecated

- [LengthFormatter](foundation/lengthformatter.md)
- [MassFormatter](foundation/massformatter.md)
- [EnergyFormatter](foundation/energyformatter.md)

## See Also

### Fundamentals

- [Numbers, Data, and Basic Values](foundation/numbers-data-and-basic-values.md)
- [Strings and Text](foundation/strings-and-text.md)
- [Collections](foundation/collections.md)
- [Dates and Times](foundation/dates-and-times.md)
- [Units and Measurement](foundation/units-and-measurement.md)
- [Filters and Sorting](foundation/filters-and-sorting.md)
