# NotificationCompat.Metric.FixedFloat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/app/NotificationCompat.java+class:androidx.core.app.NotificationCompat.Metric.FixedFloat) Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

*** ** * ** ***


```
public final class NotificationCompat.Metric.FixedFloat extends NotificationCompat.Metric.MetricValue
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.core.app.NotificationCompat.Metric.MetricValue](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.MetricValue) ||
|   | ↳ | [androidx.core.app.NotificationCompat.Metric.FixedFloat](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat) |

*** ** * ** ***

Metric corresponding to a floating point value.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#FixedFloat(float)(float value)` Creates a `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat` instance with no unit and 0 minimum and 3 maximum fractional digits. |
| `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#FixedFloat(float,java.lang.CharSequence)(float value, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html unit)` Creates a `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat` instance with 0 minimum and 2 maximum fractional digits. |
| `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#FixedFloat(float,java.lang.CharSequence,int,int)( float value, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html unit, @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 6) int minFractionDigits, @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 6) int maxFractionDigits )` Creates a `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat` instance. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html obj)` |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 6) int` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#getMaxFractionDigits()()` Maximum number of fractional digits to display. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 6) int` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#getMinFractionDigits()()` Minimum number of fractional digits to display. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#getUnit()()` The unit of measurement for the value, if required. |
| `float` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#getValue()()` The fractional value. |
| `int` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat#toString()()` |

## Public constructors

### FixedFloat

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
public FixedFloat(float value)
```

Creates a `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat` instance with no unit and 0 minimum and 3 maximum fractional digits.

### FixedFloat

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
public FixedFloat(float value, @Nullable CharSequence unit)
```

Creates a `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat` instance with 0 minimum and 2 maximum fractional digits.

| Parameters |
|---|---|
| `float value` | numeric value |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html unit` | optional unit for the value. Limit this to a few characters. |

### FixedFloat

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
public FixedFloat(
    float value,
    @Nullable CharSequence unit,
    @IntRange(from = 0, to = 6) int minFractionDigits,
    @IntRange(from = 0, to = 6) int maxFractionDigits
)
```

Creates a `https://developer.android.com/reference/androidx/core/app/NotificationCompat.Metric.FixedFloat` instance.

| Parameters |
|---|---|
| `float value` | numeric value |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/CharSequence.html unit` | optional unit for the value. Limit this to a few characters. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 6) int minFractionDigits` | minimum number of factional digits to display (0-6) |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 6) int maxFractionDigits` | maximum number of factional digits to display (0-6 and \>= `minFractionDigits`) |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | if `minFractionDigits` or ` maxFractionDigits` do not respect the specified constraints |

## Public methods

### equals

```
public boolean equals(Object obj)
```

### getMaxFractionDigits

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
public @IntRange(from = 0, to = 6) int getMaxFractionDigits()
```

Maximum number of fractional digits to display.

### getMinFractionDigits

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
public @IntRange(from = 0, to = 6) int getMinFractionDigits()
```

Minimum number of fractional digits to display.

### getUnit

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
public @Nullable CharSequence getUnit()
```

The unit of measurement for the value, if required.

This may not be shown to the user in all views.

The space allocated to this will be limited. It's recommended to limit this to just a few characters.

### getValue

Added in [1.19.1](https://developer.android.com/jetpack/androidx/releases/core#1.19.1)

```
public float getValue()
```

The fractional value.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```