# Distance

A quantity describing a distance. (For example, 10 kilometers.)

## Types

object Companion

The unit of a distance's value.

## Functions

open override fun abs(): Distance

Returns a new instance with the value from `this` as absolute value.

open operator override fun compareTo(other: Distance): Int
open operator override fun div(divisor: Double): Distance
open operator override fun div(divisor: Int): Distance

Returns a new instance with the value from `this` divided by divisor.

Expresses the distance's value in centimeters.

fun inFeet(): Double

Expresses the distance's value in feet.

Expresses the distance's value in inches.

Expresses the distance's value in kilometers.

Expresses the distance's value in meters.

Expresses the distance's value in miles.

Expresses the distance's value in millimeters.

Expresses the distance's value in centimeters rounded down.

Expresses the distance's value in feet rounded down.

Expresses the distance's value in inches rounded down.

Expresses the distance's value in kilometers rounded down.

Expresses the distance's value in meters rounded down.

Expresses the distance's value in miles rounded down.

Expresses the distance's value in millimeters rounded down.

Expresses the distance's value in yards rounded down.

Expresses the distance's value in yards.

open operator override fun minus(other: Distance): Distance

Returns a new instance that has other's value subtracted from `this`.

open operator override fun plus(other: Distance): Distance

Returns a new instance with a value equal to the sum of values from `this` and other.

open operator override fun times(factor: Double): Distance
open operator override fun times(factor: Int): Distance

Returns a new instance with the value from `this` multiplied by factor.

open override fun toDouble(unit: Distance.Unit): Double

Expresses the value of `this` under the given unit as a Double.

Expresses the value of `this` under the given unit as a Long.
Returns a string representation for the value from `this` with the given unit. Depending on decimalsMode, it will show either exactly or at most decimals amount of decimals after the separator. The unit will be suffixed depending on suffixMode.
Returns a new instance with the value from `this` as negative.