Here you can find the source of formatInteger(int integer, int length)
public static String formatInteger(int integer, int length)
//package com.java2s; /*//w ww . jav a2s .c o m * Copyright 2008 Egon Willighagen <egonw@users.sf.net> * * License: LGPL v3 */ public class Main { public static String formatInteger(int integer, int length) { String curInt = ("" + integer); while (curInt.length() < length) { curInt = " " + curInt; } return curInt; } }