List of utility methods to do Date Format As
String | fmt(double d) Format a double value to a String return formatDouble(d);
|
String | fmt(double num, int minIntDigits, int maxFracDigitis) fmt NumberFormat nf = NumberFormat.getInstance(); if (minIntDigits != -1) { nf.setMinimumIntegerDigits(minIntDigits); if (maxFracDigitis != -1) { nf.setMaximumFractionDigits(maxFracDigitis); return nf.format(num); ... |
String | fmt(long count) fmt return FORMAT.format(count);
|
String | fmt(String pattern, Object... args) fmt return MessageFormat.format(pattern, args);
|
String | fmtBdToString(BigDecimal bd, DecimalFormat df) fmt Bd To String if (bd == null) return ""; return df.format(bd.doubleValue()); |
String | fmtDate(Date date) fmt Date SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return sdf.format(date); |
String | fmtDate(Date date) fmt Date if (null == date) { return null; try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US); return sdf.format(date); } catch (Exception e) { return null; ... |
String | fmtDateTime(final Date dateTime, final String simpleDateTimeFormat) fmt Date Time final SimpleDateFormat sdf = new SimpleDateFormat(simpleDateTimeFormat); return sdf.format(dateTime); |
String | fmtMsg(final String fmt, final String arg) Format a message consisting of a format string Object[] o = new Object[1]; o[0] = arg; return MessageFormat.format(fmt, o); |
double | fmtNumStringToDouble(String s) fmt Num String To Double double d = 0.0; if (s == null || s.trim().length() == 0) return 0.0; DecimalFormat DF_4_DP = new DecimalFormat("###,##0.0000"); DecimalFormat DF_2_DP = new DecimalFormat("###,##0.00"); DecimalFormat df = DF_2_DP; try { d = df.parse(s).doubleValue(); ... |