codeblockutil
Class NumberFormatter
java.lang.Object
codeblockutil.NumberFormatter
public class NumberFormatter
- extends java.lang.Object
Class for displaying a number based on a specified
level of precision and other display parameters.
Field Summary |
static codeblockutil.NumberFormatter.StandardPrecisionSpecifier |
HIGH_PRECISION
|
static codeblockutil.NumberFormatter.StandardPrecisionSpecifier |
LOW_PRECISION
|
static codeblockutil.NumberFormatter.StandardPrecisionSpecifier |
MEDIUM_PRECISION
|
static codeblockutil.NumberFormatter.StandardPrecisionSpecifier |
VERY_LOW_PRECISION
|
Method Summary |
java.lang.String |
format(double x)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOW_PRECISION
public static final codeblockutil.NumberFormatter.StandardPrecisionSpecifier LOW_PRECISION
MEDIUM_PRECISION
public static final codeblockutil.NumberFormatter.StandardPrecisionSpecifier MEDIUM_PRECISION
HIGH_PRECISION
public static final codeblockutil.NumberFormatter.StandardPrecisionSpecifier HIGH_PRECISION
VERY_LOW_PRECISION
public static final codeblockutil.NumberFormatter.StandardPrecisionSpecifier VERY_LOW_PRECISION
NumberFormatter
public NumberFormatter()
NumberFormatter
public NumberFormatter(NumberFormatter.PrecisionSpecifier ps)
NumberFormatter
public NumberFormatter(NumberFormatter.PrecisionSpecifier ps,
char eCharacter,
boolean showZeroBeforeDecimal,
boolean showPlusInExponent,
boolean showExtraZeros)
- Parameters:
showPlusInExponent
- Whether to show the '+' character when displaying a number with e notation (e.g. 1.5e+12)
NumberFormatter
public NumberFormatter(NumberFormatter.PrecisionSpecifier ps,
java.lang.String eCharacter,
boolean showZeroBeforeDecimal,
boolean showPlusInExponent,
boolean showExtraZeros)
- Parameters:
showPlusInExponent
- Whether to show the '+' character when displaying a number with e notation (e.g. 1.5e+12)
format
public java.lang.String format(double x)