org.encog.util

## Class Format

- java.lang.Object
- - org.encog.util.Format

-     public final class Format
      extends Object

  Provides the ability for Encog to format numbers and times.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `HUNDRED_PERCENT` One hundred percent.
    `static long` | `MEMORY_GIG` Bytes in a GB.
    `static long` | `MEMORY_K` Bytes in a KB.
    `static long` | `MEMORY_MEG` Bytes in a MB.
    `static long` | `MEMORY_TERA` Bytes in a TB.
    `static long` | `MILI_IN_SEC` How many miliseconds in a second.
    `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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `formatDouble(double d, int i)` Format a double.
    `static String` | `formatInteger(int i)` Format an integer.
    `static String` | `formatMemory(long memory)` Format a memory amount, to something like 32 MB.
    `static String` | `formatPercent(double e)` Format a percent.
    `static String` | `formatPercentWhole(double e)` Format a percent with no decimal places.
    `static String` | `formatTimeSpan(int seconds)` Format a time span as seconds, minutes, hours and days.
    `static String` | `formatYesNo(boolean b)` Format a boolean as yes/no.

    - ### 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

    - #### MEMORY_K

          public static final long MEMORY_K

      Bytes in a KB.
      See Also:
        Constant Field Values

    - #### MEMORY_MEG

          public static final long MEMORY_MEG

      Bytes in a MB.
      See Also:
        Constant Field Values

    - #### MEMORY_GIG

          public static final long MEMORY_GIG

      Bytes in a GB.
      See Also:
        Constant Field Values

    - #### MEMORY_TERA

          public static final long MEMORY_TERA

      Bytes in a TB.
      See Also:
        Constant Field Values

    - #### MILI_IN_SEC

          public static final long MILI_IN_SEC

      How many miliseconds in a second.
      See Also:
        Constant Field Values

    - #### HUNDRED_PERCENT

          public static final double HUNDRED_PERCENT

      One hundred percent.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### formatDouble

          public static String 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 String formatInteger(int i)

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

    - #### formatMemory

          public static String formatMemory(long memory)

      Format a memory amount, to something like 32 MB.
      Parameters:
        `memory` - The amount of bytes.
      Returns:
        The formatted memory size.

    - #### formatPercent

          public static String formatPercent(double e)

      Format a percent. Using 6 decimal places.
      Parameters:
        `e` - The percent to format.
      Returns:
        The formatted percent.

    - #### formatPercentWhole

          public static String formatPercentWhole(double e)

      Format a percent with no decimal places.
      Parameters:
        `e` - The format to percent.
      Returns:
        The formatted percent.

    - #### formatTimeSpan

          public static 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.

    - #### formatYesNo

          public static String formatYesNo(boolean b)

      Format a boolean as yes/no.
      Parameters:
        `b` - The boolean value.
      Returns:
        The yes/no result.

Copyright © 2014. All Rights Reserved.