Java tutorial
//package com.java2s; public class Main { public static String getLotteryNumberString(int num, int digitLength) { return String.format("%0" + digitLength + "d", num); } }