java.lang.Object
de.hybris.platform.sap.sapcommonbol.transaction.util.impl.ConversionTools

public class ConversionTools extends Object
Common conversion tools
  • Method Details

    • getDecimalPointFormat

      public static String getDecimalPointFormat(Locale locale)
      Retrieves the pattern string for the decimal point representation, using Java standard functionality.
      Parameters:
      locale - the session locale
      Returns:
      the pattern string
    • getDecimalSeparator

      public static char getDecimalSeparator(Locale locale)
      Gets the decimal separator for a given locale, using Java standard functionality.
      Parameters:
      locale - the current locale
      Returns:
      the decimal separator
    • getGroupingSeparator

      public static char getGroupingSeparator(Locale locale)
      Gets the grouping separator for a given locale, using Java standard functionality.
      Parameters:
      locale - the current locale
      Returns:
      the grouping separator
    • getDateFormat

      public static String getDateFormat(Locale locale)
      Retrieves the date format pattern string for a given locale.
      Parameters:
      locale - the session loacale
      Returns:
      the pattern string
    • getSDF

      public static SimpleDateFormat getSDF(Locale locale)
      Retrieves a new instance of SimpleDateFormat for the given locale. Note: Although the result is in short format, still 4 digits are displayed for year.
      Parameters:
      locale -
      Returns:
      new instance of date formatter.
    • cutOffZeros

      public static String cutOffZeros(String argument)
      Cuts of the leading zeros for document ID display and document item display. If an format exception occurs, the input is returned.
      Parameters:
      argument - the String with leading zeros
      Returns:
      the String without leading zeros
    • getR3LanguageCode

      public static String getR3LanguageCode(String langu)
      Return the single character r3 language code for a given String.
      Parameters:
      langu - a String value
      Returns:
      a the language in R/3 format. Case sensitive! value
    • addLeadingZerosToNumericID

      public static String addLeadingZerosToNumericID(String inputString, int desiredLength)
      Method adds leading zeros to a numeric string based on a specified total length
      Parameters:
      inputString - contains the numeric String
      desiredLength - specifies the total desired length of the string
      Returns:
      String with leading zeroes appended