Package cnuphys.splot.plot
Class DoubleFormat
java.lang.Object
cnuphys.splot.plot.DoubleFormat
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringdoubleFormat(double value, int numdec) Format a doublestatic StringdoubleFormat(double value, int numdec, boolean scinot) Format a doublestatic StringdoubleFormat(double value, int numdec, int minExponent) Format a double, switching from fixed to scientific notation.static voidmain program for testing.
- 
Constructor Details- 
DoubleFormatpublic DoubleFormat()
 
- 
- 
Method Details- 
doubleFormatFormat a double- Parameters:
- value- the value to format.
- numdec- the number of digits right of the decimal.
 
- 
doubleFormatFormat a double- Parameters:
- value- the value to format.
- numdec- the number of digits right of the decimal.
- scinot- if- true, use scientific notation.
 
- 
doubleFormatFormat a double, switching from fixed to scientific notation.Example: 
 numdec = 6
 minExponent = 2
 value starts at 12345.67 and keep dividing by 10 gives
 1.234567E4
 1.234567E3
 1.234567E2
 12.345670
 1.234567
 0.123457
 1.234567E-2
 1.234567E-3
 1.234567E-4
 1.234567E-5
 1.234567E-6
 1.234567E-7
 - Parameters:
- value- the value to format.
- numdec- the number of digits right of the decimal. If the exponenent is >= n or <= -n it will use sci notation.
- minExponent- the minimum (absolute value) index for scientific notation.
 
- 
mainmain program for testing.- Parameters:
- args- command line arguments (ignored.)
 
 
-