com.softsynth.util
Class NumericOutput
java.lang.Object
com.softsynth.util.NumericOutput
public class NumericOutput
- extends java.lang.Object
Formatted numeric output.
Convert integers and floats to strings based on field widths and desired decimal places.
- Author:
- Phil Burk (C) 1999 SoftSynth.com
Method Summary |
static java.lang.String |
doubleToString(double value,
int width,
int places)
Convert double to string. |
static java.lang.String |
doubleToString(double value,
int width,
int places,
boolean leadingZeros)
Convert double to string. |
static java.lang.String |
integerToString(int n,
int width)
|
static java.lang.String |
integerToString(int n,
int width,
boolean leadingZeros)
|
static java.lang.String |
integerToString(int n,
int width,
boolean leadingZeros,
int radix)
|
static void |
main(java.lang.String[] argv)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NumericOutput
public NumericOutput()
integerToString
public static java.lang.String integerToString(int n,
int width,
boolean leadingZeros)
integerToString
public static java.lang.String integerToString(int n,
int width)
integerToString
public static java.lang.String integerToString(int n,
int width,
boolean leadingZeros,
int radix)
doubleToString
public static java.lang.String doubleToString(double value,
int width,
int places)
- Convert double to string.
- Parameters:
width
- = minimum width of formatted stringplaces
- = number of digits displayed after decimal point
doubleToString
public static java.lang.String doubleToString(double value,
int width,
int places,
boolean leadingZeros)
- Convert double to string.
- Parameters:
width
- = minimum width of formatted stringplaces
- = number of digits displayed after decimal point
main
public static void main(java.lang.String[] argv)