Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Formating the Number

  Asked By: Boell    Date: Jun 28    Category: Java    Views: 875
  

I am just wondering is there any way
to do formating on the number in Java like in pascal
and c. for example, i would like to displace only 2
decimal places or xxxxx.xx. when in pascal u put :5:2 or
something like that or 0.2 for c.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Trae Thompson     Answered On: Jun 28

The "java.text" package has all KINDS of
formatting classes.<br><br>Check out java.text.DecimalFormat
class. If you download the javadocs for the SDK from the
sun web site, you can check out all the
API's.<br><br><br>Stephen McConnell<br>http://www.crosslogic.com

 
Didn't find what you were looking for? Find more on Formating the Number Or get search suggestion and latest updates.




Tagged: