Class NumberUtils


  • public final class NumberUtils
    extends Object
    • Method Detail

      • isObjectFloatPointNumber

        public static boolean isObjectFloatPointNumber​(Object value)
      • isFloatPointType

        public static boolean isFloatPointType​(Class<?> cls)
      • isNonFloatPointType

        public static boolean isNonFloatPointType​(Class<?> cls)
      • convertToDouble

        public static Double convertToDouble​(Object object)
      • roundValue

        public static Double roundValue​(Double value,
                                        int scale)
      • getScale

        public static int getScale​(Number value)
        Gets the scale of the income value. Note that if the value will be of type Float, the scale will be defined via value.doubleValue() method call. And the scale will differ from the income.
        Parameters:
        value -
        Returns:
        number of values after the comma
      • getScale

        public static int getScale​(double value)
      • getScale

        public static int getScale​(float value)
      • isNumberType

        public static boolean isNumberType​(Class<?> cls)