List of utility methods to do Number Format Pattern
String | formatDisplay(String displayString) format Display return DECIMAL_FORMAT.format(Double.valueOf(displayString));
|
String | formatDollar(Object obj) format Dollar if (obj == null) { return ""; BigDecimal bd = (BigDecimal) obj; try { DecimalFormat intFormat = new DecimalFormat("$###,###,###,##0.00"); return intFormat.format(bd); } catch (Exception e) { ... |
String | formatDollarTd(Object obj) format Dollar Td String out = "<td style='text-align:right'>"; String strDollarAmt = formatDollar(obj); if (strDollarAmt.length() == 0) { out += " "; } else { out += strDollarAmt; out += "</td>"; ... |
String | formatFileLength(long length) Returns a nicer representation of the number as a file length. DecimalFormat format = new DecimalFormat("###0.##"); double num = length; String unit; if (length < KBYTE) { unit = "B"; } else if (length < MBYTE) { num /= KBYTE; unit = "KB"; ... |
String | formatGopNumber(Number gop) format Gop Number DecimalFormat df = new DecimalFormat("######0.000"); df.setRoundingMode(RoundingMode.DOWN); return df.format(gop); |
String | formatI18N(Object ob) format IN if (ob == null) { return ""; Double value = toDouble(ob, null); if (value == null) { return ""; value = round(value, 4); ... |
String | formatiereSpeichergroesse(long bytes) formatiere Speichergroesse if (bytes < 0) return "0 Byte"; if (bytes < 1024) return "" + bytes + " Byte"; double b = bytes / 1024.; if (b < 1024.) return DF_2.format(b) + " KByte"; return DF_2.format(b / 1024.) + " MByte"; ... |
String | formatIncludeCommas(final Number object) Format numbers for display as comma separated groups. if (object == null) { return ""; return NUMBER_FORMATTER.format(object); |
String | formatInt(final int number) Format a 'int' number with default pattern String result = null; DecimalFormat df = new DecimalFormat(INTEGER_PATTERN); try { result = df.format(number); } catch (ArithmeticException ae) { return result; |
String | formatInteger(Object obj) format Integer if (obj == null) { return ""; } else { try { Integer ival = (Integer) obj; DecimalFormat intFormat = new DecimalFormat("###,###,###,##0"); return intFormat.format(ival); } catch (Exception e) { ... |