---
title: "decimalSeparator(strategy:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/integerformatstyle/decimalseparator(strategy:)"
---

# decimalSeparator(strategy:)

Modifies the format style to use the specified decimal separator display strategy.

## Declaration

```swift
func decimalSeparator(strategy: IntegerFormatStyle<Value>.Configuration.DecimalSeparatorDisplayStrategy) -> IntegerFormatStyle<Value>
```

## Parameters

- `strategy`: The decimal separator display strategy to apply to the format style.

## Return Value

Return Value An integer format style modified to use the specified decimal separator display strategy.

## Discussion

Discussion The following example creates a default IntegerFormatStyle for the en_US locale, and a second style that uses the always strategy. It then applies each style to an array of integers. The formatting that the modified style applies adds a trailing decimal separator in all cases. let defaultStyle = IntegerFormatStyle<Int>(locale: Locale(identifier: "en_US")) let alwaysStyle = defaultStyle.decimalSeparator(strategy: .always) let nums = [100, 1000, 10000, 100000, 1000000] let defaultNums = nums.map { defaultStyle.format($0) } // ["100", "1,000", "10,000", "100,000", "1,000,000"] let alwaysNums = nums.map { alwaysStyle.format($0) } // ["100.", "1,000.", "10,000.", "100,000.", "1,000,000."]

## See Also

### Customizing style behavior

- [grouping(_:)](foundation/integerformatstyle/grouping(_:).md)
- [notation(_:)](foundation/integerformatstyle/notation(_:).md)
- [precision(_:)](foundation/integerformatstyle/precision(_:).md)
- [rounded(rule:increment:)](foundation/integerformatstyle/rounded(rule:increment:).md)
- [scale(_:)](foundation/integerformatstyle/scale(_:).md)
- [sign(strategy:)](foundation/integerformatstyle/sign(strategy:).md)
- [IntegerFormatStyle.Configuration](foundation/integerformatstyle/configuration.md)
- [NumberFormatStyleConfiguration](foundation/numberformatstyleconfiguration.md)
