# DynamicBuilders.DynamicInt32.IntFormatter.Builder

# DynamicBuilders.DynamicInt32.IntFormatter.Builder

Artifact: [androidx.wear.protolayout:protolayout-expression](https://developer.android.com/jetpack/androidx/releases/wear-protolayout)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/expression/DynamicBuilders.java+class:androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter.Builder)  
Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter.Builder "View this page in Java")


```
class DynamicBuilders.DynamicInt32.IntFormatter.Builder
```

<br />

*** ** * ** ***

Builder to create [IntFormatter](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter) objects.

## Summary

|                                                                    ### Public constructors                                                                     |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter.Builder#Builder())`()` |

|                                                                                    ### Public functions                                                                                    |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DynamicBuilders.DynamicInt32.IntFormatter](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter)                 | [build](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter.Builder#build())`()` Builds an instance with values accumulated in this Builder.                                                                                                                                                                                                                                                                                                                                                                                                 |
| [DynamicBuilders.DynamicInt32.IntFormatter.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter.Builder) | `@`[RequiresSchemaVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion)`(major = 1, minor = 200)` [setGroupingUsed](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter.Builder#setGroupingUsed(boolean))`(groupingUsed: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets whether grouping is used for the formatter.                                                                                                              |
| [DynamicBuilders.DynamicInt32.IntFormatter.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter.Builder) | `@`[RequiresSchemaVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion)`(major = 1, minor = 200)` [setMinIntegerDigits](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicInt32.IntFormatter.Builder#setMinIntegerDigits(int))`(minIntegerDigits: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Sets minimum number of integer digits for the formatter. |

## Public constructors

### Builder

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
Builder()
```  

## Public functions

### build

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun build(): DynamicBuilders.DynamicInt32.IntFormatter
```

Builds an instance with values accumulated in this Builder.  

### setGroupingUsed

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun setGroupingUsed(groupingUsed: Boolean): DynamicBuilders.DynamicInt32.IntFormatter.Builder
```

Sets whether grouping is used for the formatter. Defaults to false if not specified. If grouping is used, digits will be grouped into digit groups using a separator. Digit group size and used separator can vary in different countries/regions. As an example, for locale en_US, the following is equal to `* DynamicString.constant("1,234")`  

```kotlin
  DynamicInt32.constant(1234)
      .format(
          new IntFormatter.Builder()
                          .setGroupingUsed(true).build());
```  

### setMinIntegerDigits

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun setMinIntegerDigits(minIntegerDigits: @IntRange(from = 0) Int): DynamicBuilders.DynamicInt32.IntFormatter.Builder
```

Sets minimum number of integer digits for the formatter. Defaults to one if not specified. If minIntegerDigits is zero and the -1 \<1, the Integer part will not appear.