Use This Method to Format an Integer
Say you want the length of an integer to be exactly five digits, you can use the below method: NumberFormat nf=NumberFormat.getInstance(); // Get Instance of NumberFormatnf.setMinimumIntegerDigits(5); // The minimum Digits