File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Formating a number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Formating a number" Watch "Formating a number" New topic
Author

Formating a number

Joey Alencar
Ranch Hand

Joined: Jun 26, 2001
Posts: 43
I have one float variable that when I try to show its content, something like this is showed: 7.5E7. How can I put this number in the normal format (like 75000000.00)?
Thanks very much for any help.
Hardy Chou
Greenhorn

Joined: Jun 27, 2001
Posts: 27
use DecimalFormat class
Yogen Vadnere
Ranch Hand

Joined: Sep 20, 2001
Posts: 58
u can try this ,
formatDouble = 7500000000000.00 ;
NumberFormat converter = NumberFormat.getInstance() ;
converter.setMaximumFractionDigits(2);
converter.setMinimumFractionDigits(2);
System.out.println(converter.format(formatDouble))


Yogen Vadnere
Joey Alencar
Ranch Hand

Joined: Jun 26, 2001
Posts: 43
Thank you very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Formating a number