code: @Nullable
    public static BigDecimal parseCurrency (@Nullable final String sStr,
                                            @Nonnull final DecimalFormat aFormat,
                                            @Nullable final BigDecimal aDefault,
                                            @Nonnull final RoundingMode eRoundingMode)
    {
      // Shortcut
      if (StringHelper.hasNoText (sStr))
        return aDefault;
  
      // So that the call to "parse" returns a BigDecimal
      aFormat.setParseBigDecimal (true);
      aFormat.setRoundingMode (eRoundingMode);
  
      // Parse as double
      final BigDecimal aNum = LocaleParser.parseBigDecimal (sStr, aFormat);
      if (aNum == null)
        return aDefault;
  
      // And finally do the correct scaling, depending of the decimal format
      // fraction
      return aNum.setScale (aFormat.getMaximumFractionDigits (), eRoundingMode);
    }
docs: Parse a currency value from string using a custom rounding mode.
  
  @param sStr
  The string to be parsed.
  @param aFormat
  The formatting object to be used. May not be <code>null</code>.
  @param aDefault
  The default value to be returned, if parsing failed.
  @param eRoundingMode
  The rounding mode to be used. May not be <code>null</code>.
  @return Either default value or the {@link BigDecimal} value with the
  correct scaling.