---
title: "init(code:locale:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/decimal/formatstyle/currency/init(code:locale:)"
---

# init(code:locale:)

Creates a decimal currency format style that uses the given currency code and locale.

## Declaration

```swift
init(code: String, locale: Locale = .autoupdatingCurrent)
```

## Parameters

- `code`: The currency code to use, such as EUR or JPY.
- `locale`: The locale to use when formatting or parsing decimal values. Defaults to doc://com.apple.foundation/documentation/Foundation/Locale/autoupdatingCurrent.
