[android-components](../../index.md) / [mozilla.components.support.ktx.android.util](../index.md) / [kotlin.Int](index.md) / [dpToFloat](./dp-to-float.md)

# dpToFloat

`fun `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`.dpToFloat(displayMetrics: <ERROR CLASS>): <ERROR CLASS>` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/util/DisplayMetrics.kt#L15)

Converts a value in density independent pixels (dp) to a float value.

