Java Integer to String intToString(int i)

Here you can find the source of intToString(int i)

Description

int To String

License

Open Source License

Declaration

public static String intToString(int i) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String intToString(int i) {
        if (i < 0) {
            throw new IllegalArgumentException("Illegal call: intToString(" + i + ") - i < 0 is not allowed.");
        }// w  w w  .  j  a v a  2  s . co  m
        if (i > 999) {
            throw new IllegalArgumentException("Illegal call: intToString(" + i + ") - i > 999 is not allowed.");
        }
        return String.format("%1$03d", i);
    }
}

Related

  1. intToString(final int value)
  2. intToString(final Integer value)
  3. intToString(final long v, final int length)
  4. intToString(int i)
  5. intToString(int i)
  6. intToString(int integer)
  7. intToString(int n)
  8. intToString(int theValue, int nDigits)
  9. intToString(int val, int width)