Possible Duplicate:
How to format a number 0..9 to display with 2 digits (it’s NOT a date)
How can I write an integer number with two digits in Java? For example if the integer is less than 10, the program should return 01 to 09. I need that 0 in front of the one digit number. Something like %.2f for double type.