public class UnitSystem extends Object
UnitPrefixes for kilo, mega ang giga. Unit systems are used by UnitFormatter
and UnitComponent to split a value into components and format values to readable output like "23.5kB".
Own systems can be defined, but most use cases will be covered by the 3 predefined systems:
SI uses Si units and names (k, kilo), using 1000 as a base.IEC60027-2 uses "base 2" units and names (Ki, kibi), using 1024 as a base.JEDEC uses JEDEC units and names (similar to Si, except JEDEC uses "K" for Kilo), using 1024 as a base.
JEDEC usage is discouraged for normal usage, except where it is a requirement like in the microelectronics industry| Modifier and Type | Field and Description |
|---|---|
static UnitSystem |
IEC
IEC base 2 units (Ki) and names (kibi), using 1024 as a base
|
static UnitSystem |
JEDEC
JEDEC units (K) and names (kilo), using 1024 as a base.
|
static UnitSystem |
SI
Si units (k) and names (kilo), using 1000 as a base
|
| Modifier and Type | Method and Description |
|---|---|
UnitPrefix |
basePrefix() |
UnitPrefix |
gigaPrefix() |
UnitPrefix |
kiloPrefix() |
UnitPrefix |
megaPrefix() |
public static final UnitSystem SI
public static final UnitSystem IEC
public static final UnitSystem JEDEC
public UnitPrefix basePrefix()
public UnitPrefix kiloPrefix()
public UnitPrefix megaPrefix()
public UnitPrefix gigaPrefix()
Copyright © 2018 trivago. All rights reserved.