List of utility methods to do Currency Format
String | roundToCurrencyString(double amount) round To Currency String NumberFormat myFormatter = NumberFormat.getNumberInstance();
myFormatter.setMinimumFractionDigits(2);
myFormatter.setMaximumFractionDigits(2);
myFormatter.setGroupingUsed(false);
return myFormatter.format(amount);
|
String | toCurrency(Object objectValue) Parse double value to currency format (default Locale("es", "ES")) return toCurrency(objectValue, DEF_LOCALE_NUMBER);
|
String | toCurrencyAmountStr(Long microAmount) Converts micro amount to currency amount. double normalAmount = (double) microAmount / MICRO_MULTIPLIER; return df.format(normalAmount); |
String | toCurrencyFormat(String input) to Currency Format if (input.indexOf(".") != -1) return NumberFormat.getCurrencyInstance().format((new java.lang.Double(input)).doubleValue()); else { return NumberFormat.getCurrencyInstance().format((new java.lang.Long(input)).longValue()); |
String | toCurrencyFormat(String pattern, double value) This method actually does all for number formatting into Currency DecimalFormat formatter = new DecimalFormat(pattern); return formatter.format(value); |
String | toCurrencyWord(Double doubleValue, Locale locale) Parse double value to currency format String value; NumberFormat numberFormat = NumberFormat.getNumberInstance(locale); numberFormat.setMinimumFractionDigits(0); numberFormat.setMaximumFractionDigits(0); if (doubleValue == null) { value = numberFormat.format(new Double(0)); } else { value = numberFormat.format(doubleValue); ... |