Java Utililty Methods Integer to String

List of utility methods to do Integer to String

Description

The list of methods to do Integer to String are organized into topic(s).

Method

StringintegerToString(Integer i)
integer To String
if (i == null)
    return ("0");
return i.toString();
StringintegerToString(Integer number)
Converts the given Integer to a string, if null "?"
if (number == null)
    return "?";
else
    return number.toString();
StringintegerToString(Integer value)
integer To String
String result = null;
if (value != null) {
    result = value.toString();
return result;
StringintToStr(int nValue)
int To Str
return new Integer(nValue).toString();
StringintToStr(int priceInt)
int To Str
boolean isPositivenumber = true;
if (priceInt <= 0) {
    priceInt = Math.abs(priceInt);
    isPositivenumber = false;
if (priceInt == 0) {
    return "0.00";
String priceStr = priceInt + "";
String data1 = "";
String data2 = "";
int length = priceStr.length();
if (length >= 3) {
    data1 = priceStr.substring(0, length - 2);
    data2 = priceStr.substring(length - 2, length);
if (length == 2) {
    data1 = "0";
    data2 = priceStr;
if (length == 1) {
    data1 = "0";
    data2 = "0" + priceStr;
priceStr = data1 + "." + data2;
if (!isPositivenumber) {
    priceStr = "-" + priceStr;
return priceStr;
StringintToStr(int val)
int To Str
return "" + val;
StringintToStr(int valor, int len)
int To Str
String result = "" + valor;
while (result.length() < len) {
    result = "0" + result;
return result;
StringintToStr(int value)
int To Str
return new String(new byte[] { (byte) ((value & 0xff000000) >> 24), (byte) ((value & 0x00ff0000) >> 16),
        (byte) ((value & 0x0000ff00) >> 8), (byte) ((value & 0x000000ff)) });
StringintToStr(int value, int len)
int To Str
String result = String.valueOf(value);
if (result.length() > len) {
    result = String.copyValueOf(result.toCharArray(), 0, len);
int count = len - result.length();
for (int i = 0; i < count; i++) {
    result = "0" + result;
return result;
Stringinttostr(String intStr)
inttostr
String returnStr = "";
for (int i = 0; i < intStr.length(); i++) {
    if (String.valueOf(intStr.charAt(i)).equals("1"))
        returnStr += "a";
    if (String.valueOf(intStr.charAt(i)).equals("2"))
        returnStr += "b";
    if (String.valueOf(intStr.charAt(i)).equals("3"))
        returnStr += "c";
...