public class ScientificFormat extends Format
Format.Field
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.
|
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
|
Object |
parseObject(String source,
ParsePosition pos)
Dummy implementation of inherited abstract method.
|
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
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)
public String format(double d)
Copyright © 2014. All rights reserved.