Class DecimalFormatOperation

  • All Implemented Interfaces:
    Operation<BigDecimal,​String[],​String>

    public class DecimalFormatOperation
    extends Object
    implements Operation<BigDecimal,​String[],​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
    • Constructor Detail

      • DecimalFormatOperation

        public DecimalFormatOperation()
    • Method Detail

      • execute

        public String execute​(BigDecimal aNumber,
                              String[] someFormatString)
        Description copied from interface: Operation
        Executes the operation logic.
        Specified by:
        execute in interface Operation<BigDecimal,​String[],​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