# 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)

*** ** * ** ***


```
class NotificationCompat.Metric.FixedFloat : NotificationCompat.Metric.MetricValue
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.core.app.NotificationCompat.Metric.MetricValue](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Metric.MetricValue) ||
|   | ↳ | [androidx.core.app.NotificationCompat.Metric.FixedFloat](https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Metric.FixedFloat) |

*** ** * ** ***

Metric corresponding to a floating point value.

## Summary

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Metric.FixedFloat#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 6) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Metric.FixedFloat#getMaxFractionDigits()()` Maximum number of fractional digits to display. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 6) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Metric.FixedFloat#getMinFractionDigits()()` Minimum number of fractional digits to display. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Metric.FixedFloat#getUnit()()` The unit of measurement for the value, if required. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Metric.FixedFloat#getValue()()` The fractional value. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/app/NotificationCompat.Metric.FixedFloat#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/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)

```
FixedFloat(value: Float)
```

Creates a `https://developer.android.com/reference/kotlin/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)

```
FixedFloat(value: Float, unit: CharSequence?)
```

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

| Parameters |
|---|---|
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | numeric value |
| `unit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | 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)

```
FixedFloat(
    value: Float,
    unit: CharSequence?,
    minFractionDigits: @IntRange(from = 0, to = 6) Int,
    maxFractionDigits: @IntRange(from = 0, to = 6) Int
)
```

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

| Parameters |
|---|---|
| `value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | numeric value |
| `unit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | optional unit for the value. Limit this to a few characters. |
| `minFractionDigits: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 6) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | minimum number of factional digits to display (0-6) |
| `maxFractionDigits: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 6) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | 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 functions

### equals

```
fun equals(obj: Any!): Boolean
```

### getMaxFractionDigits

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

```
fun getMaxFractionDigits(): @IntRange(from = 0, to = 6) Int
```

Maximum number of fractional digits to display.

### getMinFractionDigits

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

```
fun getMinFractionDigits(): @IntRange(from = 0, to = 6) Int
```

Minimum number of fractional digits to display.

### getUnit

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

```
fun getUnit(): CharSequence?
```

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)

```
fun getValue(): Float
```

The fractional value.

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```