Java Integer Format formatInteger(int i, int j)

Here you can find the source of formatInteger(int i, int j)

Description

Format integer.

License

Apache License

Parameter

Parameter Description
i the i
j the j

Return

the string

Declaration

public static String formatInteger(int i, int j) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//  w  w  w.ja va2s .c o  m
     * Format integer.
     *
     * @param i the i
     * @param j the j
     * @return the string
     */
    public static String formatInteger(int i, int j) {
        String frm = "%0" + j + "d";
        String s;
        s = String.format(frm, i);
        return s;
    }
}

Related

  1. formatInt2(int n)
  2. formatInt64(long val)
  3. formatIntAsDottedOctet(int value)
  4. formatIntAsIpAddress(final int address)
  5. formatInteger(byte[] btValue, int iOffset, int iLength)
  6. formatInteger(int inInt, int inLen, boolean inComma, int inCommaPos)
  7. formatInteger(int integer, int length)
  8. formatInteger(int value, int length)
  9. formatInteger(Integer value)