This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
Can anybody help me here. I need to keep incrementing the integer in a loop and use the same integer as a string of 5 char. For example if I am incrementing i from 1 to 20000. My sequence should be printed as 00001,00002,00003......20000 Thanks, Divya
posted 12 years ago
Use DecimalFormat. It will insert leading 0's into your String. DecimalFormat num = new DecimalFormat(�00000�); num.format(yourNumber); Angel Dobbs-Sciortino [ November 05, 2003: Message edited by: Angel Dobbs-Sciortino ]