The Encog Project

org.encog.util
Class Format

java.lang.Object
  extended by org.encog.util.Format

public final class Format
extends java.lang.Object

Provides the ability for Encog to format numbers and times.


Field Summary
static int SECONDS_INA_DAY
          Seconds in a day.
static int SECONDS_INA_HOUR
          Seconds in an hour.
static int SECONDS_INA_MINUTE
          Seconds in a minute.
 
Method Summary
static java.lang.Object formatDouble(double d, int i)
          Format a double.
static java.lang.String formatInteger(int i)
          Format an integer.
static java.lang.String formatPercent(double e)
          Format a percent.
static java.lang.String formatPercentWhole(double e)
          Format a percent with no decimal places.
static java.lang.String formatTimeSpan(int seconds)
          Format a time span as seconds, minutes, hours and days.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SECONDS_INA_MINUTE

public static final int SECONDS_INA_MINUTE
Seconds in a minute.

See Also:
Constant Field Values

SECONDS_INA_HOUR

public static final int SECONDS_INA_HOUR
Seconds in an hour.

See Also:
Constant Field Values

SECONDS_INA_DAY

public static final int SECONDS_INA_DAY
Seconds in a day.

See Also:
Constant Field Values
Method Detail

formatDouble

public static java.lang.Object formatDouble(double d,
                                            int i)
Format a double.

Parameters:
d - The double value to format.
i - The number of decimal places.
Returns:
The double as a string.

formatInteger

public static java.lang.String formatInteger(int i)
Format an integer.

Parameters:
i - The integer to format.
Returns:
The integer as a string.

formatPercent

public static java.lang.String formatPercent(double e)
Format a percent. Using 6 decimal places.

Parameters:
e - The percent to format.
Returns:
The formatted percent.

formatPercentWhole

public static java.lang.String formatPercentWhole(double e)
Format a percent with no decimal places.

Parameters:
e - The format to percent.
Returns:
The formatted percent.

formatTimeSpan

public static java.lang.String formatTimeSpan(int seconds)
Format a time span as seconds, minutes, hours and days.

Parameters:
seconds - The number of seconds in the timespan.
Returns:
The formatted timespan.

The Encog Project