java.lang.Object
is.codion.common.Rounder
A utility class for rounding doubles.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Double
roundDouble
(Double d, int places) Rounds the given double toplaces
decimal places, usingRoundingMode.HALF_UP
.static Double
roundDouble
(Double d, int places, RoundingMode roundingMode) Rounds the given double toplaces
decimal places.
-
Method Details
-
roundDouble
Rounds the given double toplaces
decimal 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 toplaces
decimal 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
-