Package com.github.toolarium.common.util
Class RoundUtil
java.lang.Object
com.github.toolarium.common.util.RoundUtil
Round util class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RoundUtilGet the instancedoubleround(double val, int scale) Round double valuesintroundToInt(double val) Round double valueslongroundToLong(double val) Round double values
-
Method Details
-
getInstance
Get the instance- Returns:
- the instance
-
round
public double round(double val, int scale) Round double values- Parameters:
val- the value to roundscale- 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
-