Class DecimalFormatOperation

  • All Implemented Interfaces:
    Operation<java.math.BigDecimal,​java.lang.String[],​java.lang.String>

    public class DecimalFormatOperation
    extends java.lang.Object
    implements Operation<java.math.BigDecimal,​java.lang.String[],​java.lang.String>
    This operation formats a decimal number using a given format string. Meant to be used like:

    (123.5 formatted with "0.00")

    Optionally, you can also add a language identifier to the postfix param list in order to specify the locale to be used for the conversion, like this:

    (123.5 formatted with "0.00", "de")
    or: (123.5 formatted with "0.00", "deDE")
    Author:
    Rene Schneider - initial API and implementation
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String execute​(java.math.BigDecimal aNumber, java.lang.String[] someFormatString)
      Executes the operation logic.
      • Methods inherited from class java.lang.Object

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

      • DecimalFormatOperation

        public DecimalFormatOperation()
    • Method Detail

      • execute

        public java.lang.String execute​(java.math.BigDecimal aNumber,
                                        java.lang.String[] someFormatString)
        Description copied from interface: Operation
        Executes the operation logic.
        Specified by:
        execute in interface Operation<java.math.BigDecimal,​java.lang.String[],​java.lang.String>
        Parameters:
        aNumber - the prefix parameter, or null if none was given or the value is not available at the time of the call
        someFormatString - the postfix parameter, or null if none was given or the value is not available at the time of the call
        Returns:
        the result value