public class ScientificFormat extends Format
Format.Field
Modifier and Type | Field and Description |
---|---|
private static double |
k |
private int |
maxWidth |
private boolean |
SciNote |
private int |
sigDigit
The number of significant digits the number is formatted to is recorded by sigDigit.
|
Constructor and Description |
---|
ScientificFormat() |
ScientificFormat(int sigDigit,
int maxWidth,
boolean SciNote)
Sets the significant digits, maximum allowable width and number formatting style
(SciNote == true for Pure formatting).
|
Modifier and Type | Method and Description |
---|---|
String |
format(double d)
Format the number using scientific notation
|
StringBuffer |
format(Object obj,
StringBuffer toAppendTo,
FieldPosition pos)
Implementation of inherited abstract method.
|
String |
formatError(int eSD,
double d)
Format the number using scientific notation
|
int |
getMaxWidth()
Returns the maximum allowable width of formatted number excluding any exponentials
|
boolean |
getScientificNotationStyle()
Returns the formatting style: True means Pure scientific formatting, False means standard.
|
int |
getSigDigits()
Returns the number of significant digits
|
private double |
Log10(double x) |
Object |
parseObject(String source,
ParsePosition pos)
Dummy implementation of inherited abstract method.
|
private int |
resolveErrorSigDigit(double x,
double dx) |
void |
setMaxWidth(int mWidth)
Sets the maximum allowable length of the formattted number mantissa before exponential notation
is used.
|
void |
setScientificNotationStyle(boolean sciNote)
Sets the format style used.
|
void |
setSigDigits(int SigDigit)
Sets the number of significant digits for the formatted number
|
clone, format, formatToCharacterIterator, parseObject
private int sigDigit
private int maxWidth
private boolean SciNote
private static final double k
public ScientificFormat()
public ScientificFormat(int sigDigit, int maxWidth, boolean SciNote)
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
public Object parseObject(String source, ParsePosition pos)
parseObject
in class Format
public int getSigDigits()
public int getMaxWidth()
public boolean getScientificNotationStyle()
public void setSigDigits(int SigDigit)
public void setMaxWidth(int mWidth)
public void setScientificNotationStyle(boolean sciNote)
private double Log10(double x)
private int resolveErrorSigDigit(double x, double dx)
public String formatError(int eSD, double d)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses