Here you can find the source of formatInt2(int n)
public static final String formatInt2(int n)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w . j a v a2s. c o m * Formats an integer to 2 digits, as used for example in time. * I.e. a 0 gets printed as 00. **/ public static final String formatInt2(int n) { if (n > 9) { return Integer.toString(n); } return "0" + n; } }