List of utility methods to do Locale Format
String | format(Date date, String pattern, Locale locale) format SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern, locale); String format = simpleDateFormat.format(date); return format; |
String | format(Date inputDate, String format, Locale locale) Formats the date input to String using the format given. SimpleDateFormat formatter = null; try { formatter = new SimpleDateFormat(format, locale); return formatter.format(inputDate); } catch (Exception ex) { formatter = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.US); return formatter.format(inputDate); ... |
String | format(double d) Formats a double. NumberFormat nf = NumberFormat.getInstance(Locale.ENGLISH);
nf.setMinimumFractionDigits(6);
nf.setMaximumFractionDigits(6);
return nf.format(d);
|
String | format(Double d) format if (Double.isNaN(d)) { return "NaN "; if (Math.abs(d) > 1e-4 || d == 0) { DecimalFormat f = new DecimalFormat("#0.######", new DecimalFormatSymbols(Locale.US)); String str = f.format(d); if (str.length() > 8) { str = str.substring(0, 8); ... |
String | format(Double number) format return NUMBER_FORMAT.format(number);
|
double | format(double number) format synchronized (formatter) { return new Double(formatter.format(number)); |
String | format(double number, int fractionDigits) format return numberFormat(fractionDigits, Locale.US).format(number);
|
String | format(double value) format return NumberFormat.getInstance(Locale.US).format(value);
|
String | format(double values, boolean doNotFormat) format if (!doNotFormat) { Locale currentLocale = Locale.US; NumberFormat numberFormatter = NumberFormat.getNumberInstance(currentLocale); numberFormatter.setMinimumFractionDigits(0); numberFormatter.setMaximumFractionDigits(2); return numberFormatter.format(values); } else { return Double.toString(values); ... |
String | format(final Date date, final String format) Format a date object into a date String using a given date format. DateFormat dateFormat = new SimpleDateFormat(format, Locale.getDefault()); return dateFormat.format(date); |