Class FormatUtils


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

      Constructors 
      Constructor Description
      FormatUtils()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String formattingPrice​(java.lang.String rawPrice, java.lang.String decimalPlaceCharacter, java.lang.String formatString)
      Formats a raw price string via the rules given with the 2 parameters 'decimalPlaceCharacter' and 'formatString'.
      See priint-484.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FormatUtils

        public FormatUtils()
    • Method Detail

      • formattingPrice

        public java.lang.String formattingPrice​(java.lang.String rawPrice,
                                                java.lang.String decimalPlaceCharacter,
                                                java.lang.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