---
title: "coerceAtMost"
description: "Ensures that this value is not greater than the specified [maximumValue]."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline fun Dp.coerceAtMost(maximumValue: Dp): Dp
```


Ensures that this value is not greater than the specified `maximumValue`.

#### Returns

| | |
| --- | --- |
|  | this value if it's less than or equal to the `maximumValue` or the `maximumValue` otherwise. |




