List of utility methods to do Money Format
String | beautifyMoney(long money) beautify Money String res = ""; String tmp = String.valueOf(money); Boolean isNegative = false; if (tmp.indexOf("-") >= 0) { isNegative = true; tmp = tmp.replace("-", ""); int length = tmp.length(); ... |
String | format(Object money) format return format(money, CURRENCY_FORMAT);
|
String | format2Money(double value) format Money return format2.format(value);
|
String | formatBookkeeperMoney(double cents, Locale locale) Like money-format (e.g. NumberFormat formatter = NumberFormat.getCurrencyInstance(locale);
return formatter.format(cents / 100);
|
String | formatDoubleToMoneyString(double num) format Double To Money String java.text.DecimalFormat formate = new DecimalFormat("0.00"); return formate.format(num); |
String | formatMoney(BigDecimal bd) format Money NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US);
nf.setRoundingMode(RoundingMode.HALF_EVEN);
return nf.format(bd.setScale(2, RoundingMode.HALF_EVEN));
|
String | formatMoney(BigDecimal money, Locale locale) format Money if (money == null) return null; if (locale != null) { ResourceBundle bundle = ResourceBundle.getBundle("entityNotifications", locale); NumberFormat format = NumberFormat.getNumberInstance(locale); ((DecimalFormat) format).applyPattern(bundle.getString("format.float.invoice")); return format.format(money.doubleValue()); return new DecimalFormat("#0.00").format(money); |
String | formatMoney(BigDecimal value) Mascara texto com formatacao monetaria NumberFormat money = NumberFormat.getCurrencyInstance(new Locale("pt", "BR")); if (value != null) { return money.format(value); return money.format(0); |
String | formatMoney(double cents, Locale locale) format Money cents /= 100; DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale); DecimalFormat format = new DecimalFormat("#,##0.00", symbols); return format.format(cents); |
String | formatMoney(double dtSource) format Money java.text.DecimalFormat formatter = new java.text.DecimalFormat("#,###.00"); return "??" + formatter.format(dtSource); |