# LabelFormatter

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/slider/LabelFormatter.java)

*** ** * ** ***


```
public interface LabelFormatter
```

<br />

Known direct subclasses [BasicLabelFormatter](https://developer.android.com/reference/com/google/android/material/slider/BasicLabelFormatter)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/slider/BasicLabelFormatter` | A simple implementation of the `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter` interface, that limits the number displayed inside a discrete slider's bubble to three digits, and a single-character suffix that denotes magnitude (e.g.: 1.5K, 2.2M, 1.3B, 2T). |

*** ** * ** ***

Interface definition for applying custom formatting to the text displayed inside the bubble shown when a slider is used in discrete mode.

## Summary

| ### Constants |
|---|---|
| `default static final int` | `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter#LABEL_FLOATING() = 0` |
| `default static final int` | `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter#LABEL_GONE() = 2` |
| `default static final int` | `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter#LABEL_VISIBLE() = 3` |
| `default static final int` | `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter#LABEL_WITHIN_BOUNDS() = 1` |

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/com/google/android/material/slider/LabelFormatter#getFormattedValue(float)(float value)` |

## Constants

### LABEL_FLOATING

```
default static final int LABEL_FLOATING = 0
```

### LABEL_GONE

```
default static final int LABEL_GONE = 2
```

### LABEL_VISIBLE

```
default static final int LABEL_VISIBLE = 3
```

### LABEL_WITHIN_BOUNDS

```
default static final int LABEL_WITHIN_BOUNDS = 1
```

## Public methods

### getFormattedValue

```
abstract String getFormattedValue(float value)
```