Package io.openems.common.utils
Class IntUtils
- java.lang.Object
-
- io.openems.common.utils.IntUtils
-
public class IntUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IntUtils.Round
-
Constructor Summary
Constructors Constructor Description IntUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
roundToPrecision(double value, IntUtils.Round round, int precision)
Rounds a value to a defined precision.
-
-
-
Method Detail
-
roundToPrecision
public static int roundToPrecision(double value, IntUtils.Round round, int precision)
Rounds a value to a defined precision.Example: roundToPrecision(1234, Round.AWAY_FROM_ZERO, 100) -> 1300
- Parameters:
value
- the valueround
- the rounding modeprecision
- the decimal precision- Returns:
- the rounded value
-
-