convertLength

fun convertLength(length: Double, from: Units = Units.Meters, to: Units = Units.Kilometers): Double

Converts a length to the requested unit

Parameters

length

Length to be converted

from

Unit of the length

to

Unit to convert the length to

Throws

if the given length is negative