@Test public void convertToString() { assertEquals("", con.convertToString(null, locale)); assertEquals("0,00 " + CURRENCY, con.convertToString(BigDecimal.ZERO, locale)); assertEquals("-1.234,56 " + CURRENCY, con.convertToString(new BigDecimal("-1234.56"), locale)); }
@Override public String convertToString(final BigDecimal value, final Locale locale) { if (value == null) { return ""; } NumberFormat nf; if (locale != null) { nf = NumberHelper.getCurrencyFormat(locale); } else { nf = NumberHelper.getCurrencyFormat(ThreadLocalUserContext.getLocale()); } return nf.format(value) + " " + currency; }
CurrencyConverter extends BigDecimalConverter { @Override public String convertToString(final BigDecimal value, final Locale locale) { if (value == null) { return ""; } NumberFormat nf; if (locale != null) { nf = NumberHelper.getCurrencyFormat(locale); } else { nf = NumberHelper.getCurrencyFormat(ThreadLocalUserContext.getLocale()); } return nf.format(value) + " " + currency; } }
CurrencyConverter extends BigDecimalConverter { @Override public String convertToString(final BigDecimal value, final Locale locale) { if (value == null) { return ""; } NumberFormat nf; if (locale != null) { nf = NumberHelper.getCurrencyFormat(locale); } else { nf = NumberHelper.getCurrencyFormat(ThreadLocalUserContext.getLocale()); } return nf.format(value) + " " + currency; } CurrencyConverter();  CurrencyConverter(final BigDecimal totalAmount); }
CurrencyConverter extends BigDecimalConverter { @Override public String convertToString(final BigDecimal value, final Locale locale) { if (value == null) { return ""; } NumberFormat nf; if (locale != null) { nf = NumberHelper.getCurrencyFormat(locale); } else { nf = NumberHelper.getCurrencyFormat(ThreadLocalUserContext.getLocale()); } return nf.format(value) + " " + currency; } CurrencyConverter();  CurrencyConverter(final BigDecimal totalAmount); @Override BigDecimal convertToObject(String value, final Locale locale); @Override String convertToString(final BigDecimal value, final Locale locale); }
CurrencyConverter extends BigDecimalConverter { @Override public String convertToString(final BigDecimal value, final Locale locale) { if (value == null) { return ""; } NumberFormat nf; if (locale != null) { nf = NumberHelper.getCurrencyFormat(locale); } else { nf = NumberHelper.getCurrencyFormat(ThreadLocalUserContext.getLocale()); } return nf.format(value) + " " + currency; } CurrencyConverter();  CurrencyConverter(final BigDecimal totalAmount); @Override BigDecimal convertToObject(String value, final Locale locale); @Override String convertToString(final BigDecimal value, final Locale locale);  }