Class RoundUtil


  • public final class RoundUtil
    extends java.lang.Object
    Round util class.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static RoundUtil getInstance()
      Get the instance
      double round​(double val, int scale)
      Round double values
      int roundToInt​(double val)
      Round double values
      long roundToLong​(double val)
      Round double values
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static RoundUtil getInstance()
        Get the instance
        Returns:
        the instance
      • round

        public double round​(double val,
                            int scale)
        Round double values
        Parameters:
        val - the value to round
        scale - the next
        Returns:
        the rounded value
      • roundToInt

        public int roundToInt​(double val)
        Round double values
        Parameters:
        val - the value to round
        Returns:
        the rounded value
      • roundToLong

        public long roundToLong​(double val)
        Round double values
        Parameters:
        val - the value to round
        Returns:
        the rounded value