List of utility methods to do Integer Format
int | formatInt(String value, int defaultValue) format Int try { if (isNotEmpty(value)) { return Integer.valueOf(value).intValue(); } else { return defaultValue; } catch (Exception e) { return defaultValue; ... |
String | formatInt2(int n) Formats an integer to 2 digits, as used for example in time. if (n > 9) { return Integer.toString(n); return "0" + n; |
String | formatInt64(long val) format Int String retval = Long.toString(val); return (retval); |
String | formatIntAsDottedOctet(int value) format Int As Dotted Octet return Integer.toString((value >> 24) & 0xff) + "." + Integer.toString((value >> 16) & 0xff) + "." + Integer.toString((value >> 8) & 0xff) + "." + Integer.toString((value >> 0) & 0xff); |
String | formatIntAsIpAddress(final int address) format Int As Ip Address StringBuilder buffer = new StringBuilder(); formatIntAsIpAddress(buffer, address); return buffer.toString(); |
String | formatInteger(byte[] btValue, int iOffset, int iLength) format Integer int iLastOffset = iOffset + iLength; if (btValue.length < iLastOffset || iLength < 1) return ""; int iValue = 0; for (int iIndex = iOffset; iIndex < iLastOffset; iIndex++) { iValue <<= 8; iValue |= (btValue[iIndex] & 0xFF); return String.valueOf(iValue); |
String | formatInteger(int i, int j) Format integer. String frm = "%0" + j + "d"; String s; s = String.format(frm, i); return s; |
String | formatInteger(int inInt, int inLen, boolean inComma, int inCommaPos) This method is to format the integer. String outString = ""; int countComma = 0, tempInt; boolean fNegative = false; if (inInt < 0) { fNegative = true; inInt = inInt * (-1); if (inInt == 0) ... |
String | formatInteger(int integer, int length) format Integer String curInt = ("" + integer); while (curInt.length() < length) { curInt = " " + curInt; return curInt; |
String | formatInteger(int value, int length) format Integer StringBuffer buffer; buffer = new StringBuffer(length); for (int i = length - ("" + value).length(); i > 0; i--) { buffer.append("0"); buffer.append(value); return buffer.toString(); |