Formatted

Represents a value that has already been formatted.

You can use this class to override how an already-formatted value is displayed.

Functions

Link copied to clipboard
fun abbreviate(abbreviate: Boolean): <Error class: unknown class>

Sets whether the abbreviation should be used instead of the full name.

Link copied to clipboard
open override fun asComponent(): Component

Builds a component representing the value and unit.

Link copied to clipboard
fun autoSelectPrefix(): <Error class: unknown class>

Sets whether the prefix should be automatically selected instead of using the default prefix (if set).

Link copied to clipboard
fun decimalPlaces(decimalPlaces: Int): <Error class: unknown class>

Sets the number of decimal places. This overrides significant figures if both are set.

Link copied to clipboard
fun forceDecimalPlaces(force: Boolean): <Error class: unknown class>

Sets whether a value should always have decimal places. For example, if set to true, then the value 145 will be displayed as '145.0'

Link copied to clipboard
fun ignorePrefixes(vararg prefixes: MetricPrefix): <Error class: unknown class>
fun ignorePrefixes(prefixes: Collection<MetricPrefix>): <Error class: unknown class>

Sets what prefixes should not be used.

Link copied to clipboard
fun prefix(prefix: MetricPrefix): <Error class: unknown class>

Overrides the default prefix (and adjusts the value shown accordingly).

Link copied to clipboard
fun significantFigures(sigFigs: Int): <Error class: unknown class>

Sets the number of significant figures. For example, if this is set to 3, then a value of 0.472894 will be shown as 0.473.

Link copied to clipboard
fun unitStyle(style: Style): <Error class: unknown class>

Overrides the style of the unit.