public abstract class PrefixFormatter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
base |
static java.lang.String |
PATTERN |
| Constructor and Description |
|---|
PrefixFormatter(int base,
java.lang.String[] suffixes)
Initializes a new instance of
PrefixFormatter with the arithmetical base and a representation of the prefixes. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(double value)
Formats a
double as a string with a unit prefix |
java.lang.String |
format(long value)
Formats a
long as a string with a unit prefix |
public static final java.lang.String PATTERN
protected final int base
public PrefixFormatter(int base,
java.lang.String[] suffixes)
PrefixFormatter with the arithmetical base and a representation of the prefixes.base - the arithmetical base for the unitsuffixes - a representation of the unit prefixespublic java.lang.String format(long value)
long as a string with a unit prefixvalue - the value to formatpublic java.lang.String format(double value)
double as a string with a unit prefixvalue - the value to formatCopyright © 2018 Frederic Thevenet. All rights reserved.