Package org.openl.rules.helpers
Class NumberUtils
- java.lang.Object
-
- org.openl.rules.helpers.NumberUtils
-
public final class NumberUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DoubleconvertToDouble(Object object)static intgetScale(double value)static intgetScale(float value)static intgetScale(Number value)Gets the scale of the income value.static booleanisFloatPointType(Class<?> cls)static booleanisNonFloatPointType(Class<?> cls)static booleanisNumberType(Class<?> cls)static booleanisObjectFloatPointNumber(Object value)static DoubleroundValue(Double value, int scale)
-
-
-
Method Detail
-
isObjectFloatPointNumber
public static boolean isObjectFloatPointNumber(Object value)
-
isFloatPointType
public static boolean isFloatPointType(Class<?> cls)
-
isNonFloatPointType
public static boolean isNonFloatPointType(Class<?> cls)
-
getScale
public static int getScale(Number value)
Gets the scale of the income value. Note that if the value will be of typeFloat, 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)
-
-