Unit Format
constructor(name: String, singular: Component, plural: Component, abbreviation: Component? = null, defaultPrefix: MetricPrefix = MetricPrefix.NONE, defaultStyle: Style = Style.empty(), usePrefixes: Boolean = true)(source)
Parameters
name
The English name of the unit (for example 'kilograms')
singular
A component representing the long singular form of this unit (kilogram, meter, liter, etc)
plural
A component representing the long plural form of this unit (kilograms, meters, liters, etc)
abbreviation
A component representing the abbreviated form of this unit (kg, m, L, etc)
default Prefix
The prefix (kilo, nano, etc) used for this unit unless specified while formatting. For example, if you create a 'grams' unit and specify 'kilo' as the default prefix, calling format with 100 will return '100 kilograms'
default Style
The style to apply to the unit (not the value)
use Prefixes
Whether we should automatically calculate and apply a prefix (kilo, nano, etc) to the output.