Try:
DecimalFormat df = new DecimalFormat("00000");
System.out.println("Number: " + df.format(20));
Best regards,
Fabio Martins
> Importance: Normal
> Date: Thu, 29 Nov 2001 23:04:38 -0500
> Reply-to: [EMAIL PROTECTED]
> From: "Jose F. Osorio" <[EMAIL PROTECTED]>
> Subject: Re: Java number format question....please help
> To: [EMAIL PROTECTED]
> The following should do:
>
> import java.text.*;
>
> DecimalFormat df = null;
> df=new DecimalFormat();
> df.setMaximumFractionDigits(0);
> df.applyPattern("00000");
> System.out.println( "Zero-Filled: " + df.format( 20 ));
>
> Good Luck.
> Jose
>
> > -----Original Message-----
> > From: A mailing list for discussion about Sun Microsystem's Java Servlet
> > API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of KL
> > OOI
> > Sent: Thursday, November 29, 2001 9:29 PM
> > To: [EMAIL PROTECTED]
> > Subject: Java number format question....please help
> >
> >
> > Hi all,
> >
> > How do I format a integer 20 to 00020 ?
> >
> > Thanks.
> >
> > Regards,
> > KL OOI
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html