Class IntUtils

java.lang.Object
io.openems.common.utils.IntUtils

public class IntUtils extends Object
  • Constructor Details

    • IntUtils

      public IntUtils()
  • Method Details

    • 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 value
      round - the rounding mode
      precision - the decimal precision
      Returns:
      the rounded value