This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes number format question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "number format question" Watch "number format question" New topic
Author

number format question

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

may i know what should i do if i want print 0 as 0000 and 11 as 0011 999 as 0999... it seems int a =0000 prints only 0 not the one i want.


please let me know how to format these number and let me know if there is any method to accomplish this task.
Jonas Isberg
Ranch Hand

Joined: Mar 18, 2003
Posts: 118
I suggest you take a look at the java.util.Formatter class.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38075
    
  22
Jonas Isberg wrote:I suggest you take a look at the java.util.Formatter class.
Agree, but you will probably find this Java™ Tutorials page easier to understand.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: number format question
 
Similar Threads
Shift operator doubt
Shift operators !
lang fund Ques from dan mock exam
hexadecimal format