List of utility methods to do Locale Format
String | format(final Date date, final String format) Formats a Date according to the first format in the array. if (date == null) { throw new IllegalArgumentException("Date is null"); final SimpleDateFormat formatter = new SimpleDateFormat(format, Locale.US); formatter.setTimeZone(TIMEZONE_GMT); return formatter.format(date); |
String | format(final double num, final int prec) format nf.setMinimumFractionDigits(prec);
nf.setMaximumFractionDigits(prec);
nf.setGroupingUsed(false);
return nf.format(num);
|
String | format(final String bundleKey, final String messageKey, final Locale locale, final Object... arguments) format assert bundleKey != null; assert messageKey != null; assert locale != null; MessageFormat messageFormat; StringBuffer result; FieldPosition pos; messageFormat = getMessageFormat(bundleKey, messageKey, locale); result = new StringBuffer(); ... |
String | format(int[] a) Formats the int array a for printing purposes. return (a == null) ? "null" : (a.length == 0) ? "" : formatTo(new StringBuilder(), a, ", ").toString(); |
String | format(Locale locale, ResourceBundle bundle, String key, Object... args) Formats a message from the specified ResourceBundle using the specified arguments. MessageFormat formatter = new MessageFormat(""); formatter.setLocale(locale); formatter.applyPattern(bundle.getString(key)); return formatter.format(args); |
String | format(Locale locale, String key, Object... arguments) format String pattern = get(locale, key);
return MessageFormat.format(pattern, arguments);
|
String | format(Number number) Formats the specified number to be readable to the human eye. StringBuilder bldr = new StringBuilder(); int power = (int) Math.log10(number.doubleValue()); double value = Math.floor(number.doubleValue() / Math.pow(10, power / 3 * 3)); bldr.append(DECIMAL_FORMAT.format(value)).append(FORMAT.charAt(power / 3)); bldr.append(" (").append(NUMBER_FORMAT.format(number)).append(")"); return bldr.toString(); |
String | format(Number number, Locale locale) format return NumberFormat.getInstance(Locale.CANADA_FRENCH).format(number);
|
Object | format(Object input, int style) DOC Zqin Comment method "format". try { if (checkInput(input)) { DecimalFormat format = null; BigDecimal zero = new BigDecimal(0); BigDecimal temp = new BigDecimal(input.toString()); BigDecimal min = new BigDecimal(10E-5); BigDecimal max = new BigDecimal(9999 * 10E-5); boolean isUseScientific = false; ... |
String | format(String bundleName, Locale locale, String key, Object arg1) format return format(bundleName, locale, key, new Object[] { arg1 }); |