[android-components](../../index.md) / [mozilla.components.support.ktx.android.util](../index.md) / [kotlin.Float](index.md) / [dpToPx](./dp-to-px.md)

# dpToPx

`fun `[`Float`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`.dpToPx(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#L22)

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

