Java tutorial
//package com.java2s; public class Main { public static String formatNumber(int number) { String string = new String(); if (number < 10) { string = "00" + number; } else if (number >= 10 && number < 100) { string = "0" + number; } else { string = String.valueOf(number); } return string; } }