View Single Post
  #1 (permalink)  
Old 12-30-2007, 02:17 PM
Java Tip Java Tip is offline
Moderator
 
Join Date: Nov 2007
Posts: 1,659
Java Tip will become famous soon enoughJava Tip will become famous soon enough
DecimalFormat class
DecimalFormat class is a very useful class that number formatting and parsing options. Example below shows a use of DecimalFormat class to format an Integer.

Code:
int numb = 3; String rptNumb; DecimalFormat df = new DecimalFormat("000"); rptNumb = df.format(numb); System.out.println(rptNumb);
Reply With Quote
Sponsored Links