Java tutorial
//package com.java2s; public class Main { public static String getZeroFormat(int data) { String result = ""; try { result = String.format("%02d", data); } catch (Exception e) { e.printStackTrace(); result = ""; } return result; } }