Java examples for java.lang:double Format
Format to Double Digit
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int paramInt = 2; System.out.println(toDoubleDigit(paramInt)); }//from w w w . ja va 2 s . com /** * * @param paramInt * @return */ public static String toDoubleDigit(int paramInt) { if (Math.abs(paramInt) < 10) { return ("0" + paramInt); } return "" + paramInt; } }