File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes formating numeric display.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "formating numeric display.." Watch "formating numeric display.." New topic

formating numeric display..

Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
hi all,
is it possible to format the decimal display of numeric values ?? i mean, i want 1 to be displayed as 001 and 2 as 002, like that 10 will be displayed as 010 .... i hope my question is clear !!

SCJP, SCWCD, SCBCD, Oracle Certified Professional (SQL n PL/SQL)
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I love visiting this board because it makes me go out and learn stuff. Try this:

There are a number of formatters in the JDK. Look at classes derived from Format.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
hi stan,
thanks for ur reply..that is wat i was looking for..Im too lazy to go thru the
Gaurav Mac Mathur
Ranch Hand

Joined: Feb 19, 2002
Posts: 47
I agree. Here's the link:
subject: formating numeric display..
jQuery in Action, 3rd edition