public class SI extends Object
| Constructor and Description |
|---|
SI() |
| Modifier and Type | Method and Description |
|---|---|
static String |
format(long number)
Formats the specified number using 1000-based units.
|
static String |
format(long number,
boolean useBinaryUnits)
Formats the specified number using the specified units.
|
static String |
format(long number,
boolean useBinaryUnits,
boolean addSpace)
Formats the specified number using the specified units.
|
static String |
format(long number,
int digits,
boolean useBinaryUnits,
boolean addSpace)
Formats the specified number using the specified units.
|
static String |
formatBinary(long number)
Formats the specified number using 1024-based units.
|
public static String format(long number)
number - The number to encodepublic static String formatBinary(long number)
number - The number to encodepublic static String format(long number, boolean useBinaryUnits)
useBinaryUnits is true, 1024-based units
(marked by an 'i' after the unit character, e.g. 'Ki' for 1024) will be
used; if it is false, 1000-based units will be used.number - The number to encodeuseBinaryUnits - Whether to use binary or decimal unitspublic static String format(long number, boolean useBinaryUnits, boolean addSpace)
useBinaryUnits is true, 1024-based units
(marked by an 'i' after the unit character, e.g. 'Ki' for 1024) will be
used; if it is false, 1000-based units will be used.number - The number to encodeuseBinaryUnits - Whether to use binary or decimal unitsaddSpace - Whether to add a space between the number and the unitpublic static String format(long number, int digits, boolean useBinaryUnits, boolean addSpace)
useBinaryUnits is true, 1024-based units
(marked by an 'i' after the unit character, e.g. 'Ki' for 1024) will be
used; if it is false, 1000-based units will be used.number - The number to encodedigits - The number of digits after the decimal pointuseBinaryUnits - Whether to use binary or decimal unitsaddSpace - Whether to add a space between the number and the unitCopyright © 2026. All rights reserved.