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

# grouping(_:)

Modifies the format style to use the specified grouping.

## Declaration

```swift
func grouping(_ group: FloatingPointFormatStyle<Value>.Configuration.Grouping) -> FloatingPointFormatStyle<Value>
```

## Parameters

- `group`: The grouping to apply to the format style.

## Return Value

Return Value A floating-point format style modified to use the specified grouping.

## Discussion

Discussion The following example creates a default FloatingPointFormatStyle for the en_US locale, and a second style that never uses grouping. It then applies each style to an array of floating-point values. The formatting that the the modified style applies eliminates the three-digit grouping usually performed for the en_US locale. let defaultStyle = FloatingPointFormatStyle<Double>(locale: Locale(identifier: "en_US")) let neverStyle = defaultStyle.grouping(.never) let nums = [100.1, 1000.2, 10000.3, 100000.4, 1000000.5] let defaultNums = nums.map { defaultStyle.format($0) } // ["100.1", "1,000.2", "10,000.3", "100,000.4", "1,000,000.5"] let neverNums = nums.map { neverStyle.format($0) } // ["100.1", "1000.2", "10000.3", "100000.4", "1000000.5"]

## See Also

### Customizing style behavior

- [decimalSeparator(strategy:)](foundation/floatingpointformatstyle/decimalseparator(strategy:).md)
- [locale(_:)](foundation/floatingpointformatstyle/locale(_:).md)
- [notation(_:)](foundation/floatingpointformatstyle/notation(_:).md)
- [precision(_:)](foundation/floatingpointformatstyle/precision(_:).md)
- [rounded(rule:increment:)](foundation/floatingpointformatstyle/rounded(rule:increment:).md)
- [scale(_:)](foundation/floatingpointformatstyle/scale(_:).md)
- [sign(strategy:)](foundation/floatingpointformatstyle/sign(strategy:).md)
- [FloatingPointFormatStyle.Configuration](foundation/floatingpointformatstyle/configuration.md)
- [NumberFormatStyleConfiguration](foundation/numberformatstyleconfiguration.md)
