edu.swri.swiftvis.plot
Class NumberFormatter

java.lang.Object
  extended by edu.swri.swiftvis.plot.NumberFormatter

public class NumberFormatter
extends java.lang.Object

This class is used to do formatting on numbers to make them look good.


Constructor Summary
NumberFormatter()
           
 
Method Summary
static double cleanBounds(double[] minMax)
          Sets the values to something that contains the bounds passed in, but which uses numbers rounded for better display.
static double cleanBounds(double[] minMax, int sigFigs)
          Sets the values to something that contains the bounds passed in, but which uses numbers rounded for better display.
static void cleanBoundsOld(double[] minMax)
          Sets the values to something that contains the bounds passed in, but which uses numbers rounded for better display.
static java.lang.String format(double num, double spacing, double max)
           
static java.lang.String format(double num, int sigFigs)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberFormatter

public NumberFormatter()
Method Detail

main

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

cleanBoundsOld

public static void cleanBoundsOld(double[] minMax)
Sets the values to something that contains the bounds passed in, but which uses numbers rounded for better display.


cleanBounds

public static double cleanBounds(double[] minMax)
Sets the values to something that contains the bounds passed in, but which uses numbers rounded for better display. It returns a recommended step to use between intervals.


cleanBounds

public static double cleanBounds(double[] minMax,
                                 int sigFigs)
Sets the values to something that contains the bounds passed in, but which uses numbers rounded for better display. It returns a recommended step to use between intervals. The second parameter tells it how many significant figures will be


format

public static java.lang.String format(double num,
                                      int sigFigs)

format

public static java.lang.String format(double num,
                                      double spacing,
                                      double max)