Class FormatUtils

java.lang.Object
com.priint.pubserver.util.FormatUtils

public class FormatUtils extends Object
Utility class with methods to format raw 'input' strings.
Since:
4.1
  • Constructor Details

    • FormatUtils

      public FormatUtils()
  • Method Details

    • formattingPrice

      public String formattingPrice(String rawPrice, String decimalPlaceCharacter, String formatString)
      Formats a raw price string via the rules given with the 2 parameters 'decimalPlaceCharacter' and 'formatString'.
      See priint-484.
      Parameters:
      rawPrice - The input, the price that have to be formatted.
      decimalPlaceCharacter - It is needed for parsing the rawPrice string to find the position of the decimal character.
      It can only be the single character dot (.) or comma (,).
      formatString - Defines how the price will be formatted.
      To identify the decimalPlace the strings before the decimal is formatted with '#', the string after as '0' (e.g.: #.###.###,000 or #.00).
      Allowed #-patterns (here shown with a dot as thousands separator) are: #, #.##, #.###, #.##.##, #.###.###
      Allowed decimal separator: ",", "."
      Allowed thousands separator: ",", ".", "'"
      At the beginning or the end of the formatString are all known currency symbols and currency short texts allowed also, separated with or without a blank.
      Returns:
      The formatted price.
      Since:
      4.1