Package jebl.util

Class NumberFormatter

java.lang.Object
jebl.util.NumberFormatter

public class NumberFormatter extends Object
An interface for a numerical column in a log.
Version:
$Id: NumberFormatter.java 1003 2009-06-05 04:18:57Z stevensh $
Author:
Andrew Rambaut, Alexei Drummond
  • Constructor Details

    • NumberFormatter

      public NumberFormatter(int sf)
  • Method Details

    • setSignificantFigures

      public void setSignificantFigures(int sf)
      Set the number of significant figures to display when formatted. Setting this overrides the decimal places option.
    • getSignificantFigures

      public int getSignificantFigures()
      Get the number of significant figures to display when formatted. Returns -1 if maximum s.f. are to be used.
    • setDecimalPlaces

      public void setDecimalPlaces(int dp)
      Set the number of decimal places to display when formatted. Setting this overrides the significant figures option.
    • getDecimalPlaces

      public int getDecimalPlaces()
      Get the number of decimal places to display when formatted. Returns -1 if maximum d.p. are to be used.
    • getFormattedValue

      public String getFormattedValue(double value)
      Returns a string containing the current value for this column with appropriate formatting.
      Returns:
      the formatted string.