convert

Converts a value in a ScientificUnit to the value of another unit with the same PhysicalQuantity

Return

the Double value in to that is equivalent to value in this unit

Parameters

Quantity

the type of PhysicalQuantity of both units

value

the Number value to convert

to

the ScientificUnit to convert the value into


fun <Quantity : PhysicalQuantity> ScientificUnit<Quantity>.convert(value: Number, to: ScientificUnit<Quantity>, round: Int, roundingMode: RoundingMode = RoundingMode.RoundHalfEven): Double

Converts a value in a ScientificUnit to the value of another unit with the same PhysicalQuantity and rounds it

Return

the Double value in to that is equivalent to value in this unit

Parameters

Quantity

the type of PhysicalQuantity of both units

value

the Number value to convert

to

the ScientificUnit to convert the value into

round

The number of digits a rounded value should have after its decimal point

roundingMode

The RoundingMode to apply when scaling


fun <Quantity : PhysicalQuantity> ScientificUnit<Quantity>.convert(value: Decimal, to: ScientificUnit<Quantity>, round: Int, roundingMode: RoundingMode = RoundingMode.RoundHalfEven): Decimal

Converts a value in a ScientificUnit to the value of another unit with the same PhysicalQuantity

Return

the Decimal value in to that is equivalent to value in this unit

Parameters

Quantity

the type of PhysicalQuantity of both units

value

the Decimal value to convert

to

the ScientificUnit to convert the value into

round

The number of digits a rounded value should have after its decimal point

roundingMode

The RoundingMode to apply when scaling


Converts a value in a ScientificUnit to the value of another unit with the same PhysicalQuantity

Return

the Decimal value in to that is equivalent to value in this unit

Parameters

Quantity

the type of PhysicalQuantity of both units

value

the Decimal value to convert

to

the ScientificUnit to convert the value into