aspose file tools*
The moose likes Beginning Java and the fly likes Trim in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trim in java" Watch "Trim in java" New topic
Author

Trim in java

rose hegde
Ranch Hand

Joined: Oct 22, 2003
Posts: 40
Hello,
I am getting a result from java file which is of type double.When displaying this number through jsp file i want only 2 digits to appear after decimal point.
Pls help
Benny Tang
Greenhorn

Joined: Aug 03, 2003
Posts: 26
Hi,
You can use the method setMaximumFractionDigit() in java.text.NumberFormat to manipulate the format of the number.
Benny T
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

This really has nothing to do with JSPs, so I'm moving it along to Java In General (Beginner).
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
rose hegde
Ranch Hand

Joined: Oct 22, 2003
Posts: 40
Can anyone tell me exactly how to do this?
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Check the API docs for DecimalFormat and NumberFormat


42
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trim in java
 
Similar Threads
CD Rom auto run
CD Rom auto run
create tables using java code by fetching from .sql file
Ant error: Make sure you have it in you classpath
JSP and Java wait help