The list of methods to do Currency Format are organized into topic(s).
String
currency(double amount, String language, String country) Format a currency amount in a given locale.
Locale locale = null;
if (language == null || country == null) {
locale = Locale.getDefault();
} else {
locale = new Locale(language, country);
return currency(amount, locale);
NumberFormat
currencyFormat() currency Format
NumberFormat format = NumberFormat.getNumberInstance();
format.setMaximumFractionDigits(2);
format.setMinimumFractionDigits(2);
return format;
String
format2CurrencyWithComma(double amt) format Currency With Comma
String formattedAmount = format2DecimalPointMoneyWithComma(amt);
if (formattedAmount.startsWith("(")) {
return formattedAmount.replace("(", "($");
} else {
return "$" + formattedAmount;
String
formatAsCurrency(Number amount) Convenience method for converting Number to currency string representation with minimal overhead.
return amount == null ? "" : CURRENCY_FORMAT.get().format(amount);
String
formatCurrency(BigDecimal amount) format Currency
if (amount.compareTo(BigDecimal.ZERO) <= 0) {
return "0";
DecimalFormat df = new DecimalFormat("#,###.00");
return df.format(amount);