Android examples for java.lang:String Pad
pad 0 for single digit
import android.content.Context; import android.graphics.Color; import java.text.DecimalFormat; public class Main{ public static String pad(int c) { if (c >= 10) return String.valueOf(c); else//from w ww . j ava 2 s. c o m return "0" + String.valueOf(c); } }