• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Number generation

 
michael yue
Ranch Hand
Posts: 204
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I dont know how to come up with the simplest algorithm for this problem.
I want to generate a range of numbers if the front of the numbers begin with 0.
Example start number is 001 and end number is 008
then it will generate 001,002,003 and so on till 008.

Also i am a bit stumped on preventing wrong input generation for example when first number input 001 but end number input 0005.
Thanks a lot. Hope i am clear enough.
 
Mark Patrick
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the API specification for java.text.DecimalFormat.
 
Mark Patrick
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will do the trick:

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic