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
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> __________________________________________________________________
> _________
> 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
>

___________________________________________________________________________
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

Reply via email to