convertToWeightUnits

fun <T> convertToWeightUnits(valueKg: Double, units: WeightUnits, cls: Class<T>): T

Convert from kilograms to units

Return

value converted to units

See also

Parameters

valueKg

value in kilograms

units

units for value to convert to

cls

class of converted value

T

type of value

Throws

when unit and class defined incorrectly


fun <T> convertToWeightUnits(valueKg: Float, units: WeightUnits, cls: Class<T>): T

Deprecated

Weight should be passed as Double

Convert from kilograms to units

Return

value converted to units

See also

Parameters

valueKg

value in kilograms

units

units for value to convert to

cls

class of converted value

T

type of value

Throws

when unit and class defined incorrectly