---
title: "times"
description: "Multiply a [TextUnit] by a scalar.

This operation works only if the right operand is not equal to [TextUnit.Unspecified]. The result
of this operation is the same unit type of the given one."
type: "function"
---

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


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


```kotlin
inline operator fun Float.times(other: TextUnit): TextUnit
```


Multiply a `TextUnit` by a scalar.

This operation works only if the right operand is not equal to `TextUnit.Unspecified`. The result
of this operation is the same unit type of the given one.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline operator fun Double.times(other: TextUnit): TextUnit
```


Multiply a `TextUnit` by a scalar.

This operation works only if the right operand is not equal to `TextUnit.Unspecified`. The result
of this operation is the same unit type of the given one.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline operator fun Int.times(other: TextUnit): TextUnit
```


Multiply a `TextUnit` by a scalar.

This operation works only if the right operand is not equal to `TextUnit.Unspecified`. The result
of this operation is the same unit type of the given one.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline operator fun Float.times(other: Dp) = Dp(this * other.value)
```


<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline operator fun Double.times(other: Dp) = Dp(this.toFloat() * other.value)
```


<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline operator fun Int.times(other: Dp) = Dp(this * other.value)
```


<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline operator fun Int.times(size: DpSize) = size * this
```


<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline operator fun Float.times(size: DpSize) = size * this
```


<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline operator fun Int.times(size: IntSize) = size * this
```


Returns an `IntSize` with `size`'s `IntSize.width` and `IntSize.height` multiplied by `this`.



