---
title: "formatted(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/decimal/formatted(_:)"
---

# formatted(_:)

Formats the decimal using the provided format style.

## Declaration

```swift
func formatted<S>(_ format: S) -> S.FormatOutput where S : FormatStyle, S.FormatInput == Decimal
```

## Parameters

- `format`: The format style to apply when formatting the decimal.

## Return Value

Return Value A localized, formatted string representation of the decimal.

## Discussion

Discussion Use this method when you want to format a single decimal value with a specific format style or multiple format styles. The following example shows the results of formatting a given decimal value with format styles for the en_US and fr_FR locales: let decimal: Decimal = 123456.789 let usStyle = Decimal.FormatStyle(locale: Locale(identifier: "en_US")) let frStyle = Decimal.FormatStyle(locale: Locale(identifier: "fr_FR")) let formattedUS = decimal.formatted(usStyle) // 123,456.789 let formattedFR = decimal.formatted(frStyle) // 123 456,789

## See Also

### Formatting decimals

- [formatted()](foundation/decimal/formatted().md)
- [Decimal.FormatStyle](foundation/decimal/formatstyle.md)
