Class DoubleUtilities

java.lang.Object
org.gvsig.utils.DoubleUtilities

public class DoubleUtilities extends Object
This class has some methods to manage "Doubles"
Author:
Jorge Piera LlodrĂ¡ (piera_jor@gva.es)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    format(double value, char decimalSeparator, int decimalsNumber)
    Formats a double with an specified number of decimals.
    static double
    format(double num, int n)
    Formats a double with an specified number of decimals.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DoubleUtilities

      public DoubleUtilities()
  • Method Details

    • format

      public static double format(double value, char decimalSeparator, int decimalsNumber)
      Formats a double with an specified number of decimals. It removes the separator character of the integer part.
      Parameters:
      value - Separator char of the integer part
      decimalSeparator - Separator char of the decimal part
      decimalsNumber - Number of decimals
      Returns:
      The formatted double
    • format

      public static double format(double num, int n)
      Formats a double with an specified number of decimals.
      Parameters:
      num - Value to tail
      n - Number of decimals
      Returns:
      The formatted double