Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Java Number Format 
 

In programming languages, a pattern of special characters is used to specify the format of the number. In java this is achieved by the java

 

Java Number Format

                         

In programming languages, a pattern of special characters is used to specify the format of the number. In java this is achieved by the java.text.NumberFormat class. NumberFormat is the abstract base class for all number formats. It provides the interface for formatting and parsing numbers such as Strings to and from doubles and longs, and vice versa. It also helps you to format and parse numbers for any locale.
                     
A format is given by a pattern of symbols. For example, the pattern "0.000" indicates that the number should begin with 0 if it is less than 1.0 and that the number of decimal places will be 3 and padded with 0 if necessary to reach 3 places.
               
Another example, the pattern "0.###" indicates that the number should begin with 0 if it is less than 1.0 and that the number of decimal places will be up to 3 and padded with blanks if the fraction needs less than 3 places.
                
Read example at:

http:/www.roseindia.net/java/beginners/DecimalFormatExample.shtml

 

                         

» View all related tutorials
Related Tags: java c programming com compiler function language fun io word implementation compile native key signals pil this for unc keyword

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.