Quantity
A base interface for quantities. Outlines the common operations to retrieve values and perform mathematical operations.
Parameters
Q
The quantity type implementing this interface.
U
An enum type that contains the units that the quantity's values can be in.
Inheritors
Types
Functions
Link copied to clipboard
abstract fun toString(unit: U, decimals: Int = 0, suffixMode: Quantity.SuffixMode = SuffixMode.NOT_SEPARATED, decimalsMode: Quantity.DecimalsMode = DecimalsMode.EXACT): String
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.
Link copied to clipboard
Returns a new instance with the value from this
as negative.