Class CoreAlgorithms

java.lang.Object
de.hybris.platform.core.CoreAlgorithms

public class CoreAlgorithms extends Object
This class provides miscellaneous functions used in all hybris platform layers. By now these are just price rounding and price conversion .
  • Field Details

  • Constructor Details

    • CoreAlgorithms

      public CoreAlgorithms()
  • Method Details

    • setLegacyConfigProvider

    • round

      public static double round(double value, int digits)
      Rounds a double value to the specified digits.
      Parameters:
      value -
      digits -
      Returns:
       round(value * 10 ˆ digits) / 10 ˆ digits
       
    • convert

      public static double convert(double sourceFactor, double targetFactor, double value)
      Used to converts a numeric price value from one currency to another. Please note that this method does no rounding. You can use it in connection with round(double, int) to achieve this.
      Parameters:
      sourceFactor - the conversionFactor of the source currency
      targetFactor - the conversionFactor of the target currency
      value - the source value
      Returns:
       value * targetFactor / sourceFactor