com.softsynth.util
Class NumericOutput

java.lang.Object
  extended by 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

Constructor Summary
NumericOutput()
           
 
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
 

Constructor Detail

NumericOutput

public NumericOutput()
Method Detail

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 string
places - = 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 string
places - = number of digits displayed after decimal point

main

public static void main(java.lang.String[] argv)