java.lang.Object
is.codion.common.Rounder
A utility class for rounding doubles.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleroundDouble(Double d, int places) Rounds the given double toplacesdecimal places, usingRoundingMode.HALF_UP.static DoubleroundDouble(Double d, int places, RoundingMode roundingMode) Rounds the given double toplacesdecimal places.
-
Method Details
-
roundDouble
Rounds the given double toplacesdecimal places, usingRoundingMode.HALF_UP.- Parameters:
d- the double to round, null results in a null return valueplaces- the number of decimal places- Returns:
- the rounded value or null if the parameter value was null
-
roundDouble
Rounds the given double toplacesdecimal places.- Parameters:
d- the double to round, null results in a null return valueplaces- the number of decimal placesroundingMode- the rounding mode- Returns:
- the rounded value or null if the parameter value was null
-